feat: Add compact AST dump

Introduce a new `dump_ast_compact` function for the environment and
Dumper. This function provides a simplified, human-readable
representation of the AST, focusing on inferred types and purity markers
instead of detailed debug information.

This change adds:
- A `compact` flag to the `Dumper` struct.
- The `dump_compact` method to the `Dumper`.
- The `dump_ast_compact` method to the `Environment`.
- A new `dump_ast_compact` command-line argument for the `ast` binary.
- A new MCP server endpoint `dump_ast_compact`.
- A `CompactMetadata` trait to abstract over different metadata types
  for compact display.
- Updates to documentation and CLI help messages.
This commit is contained in:
2026-03-29 18:28:10 +02:00
parent 10a7fcb576
commit 0e806b9e5d
6 changed files with 156 additions and 23 deletions
+3 -3
View File
@@ -162,10 +162,10 @@ impl CompilerApp {
fn dump_ast(&mut self) {
self.env = Environment::new();
self.env.optimization = true; // Enable optimization for AST dump
match self.env.dump_ast(&self.source_code) {
match self.env.dump_ast_compact(&self.source_code) {
Ok(dump) => {
self.output_log = format!("--- BOUND AST DUMP ---\n\n{}", dump);
self.output_log = format!("--- AST DUMP ---\n\n{}", dump);
}
Err(e) => {
self.output_log = format!("Error during AST Binding: {}", e);