ast: improved the implementation of syntactic_ast
All checks were successful
ci/woodpecker/push/build Pipeline was successful
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:
11
bin/comp.ml
11
bin/comp.ml
@@ -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
|
||||
| _ -> ()
|
||||
|
||||
Reference in New Issue
Block a user