ast: improved the implementation of syntactic_ast
All checks were successful
ci/woodpecker/push/build Pipeline was successful

debug: added debug functions for the syntactic_ast module
Modified the compiler executable to test a little bit.

todo: Some nodes of the syntactic ast are not yet emitted,
This commit is contained in:
2026-01-03 18:30:47 +03:00
parent cb94372f29
commit 6d95977324
3 changed files with 122 additions and 31 deletions

View File

@@ -29,3 +29,14 @@ let def = Parser.parse_str "(define (f x) (+ x 1))
let desugared = List.map Compiler.Sugar.desugar def
let () = List.iter (fun x -> Printf.printf "%s\n" (dbg_print_start x) ) desugared
let () = print_newline ()
let ( let* ) = Result.bind;;
let e =
(*let def = Parser.parse_str "(lambda () (+ x 1) (+ x 1))" in
*)
let* top = Compiler.Syntactic_ast.make (List.hd def) in
Ok (Printf.printf "%s\n" (Compiler.Syntactic_ast.print top))
let _ = match e with
| Error s -> Printf.printf "%s\n" s
| _ -> ()