e0/bin/main.ml
Michael Zhang 4ea1071ca1
a
2022-03-23 01:12:37 -05:00

12 lines
369 B
OCaml

open E0
let () =
let p = Lexing.from_channel stdin |> Parse.try_parse in
match p with
| Error msg -> Printf.eprintf "Could not load program: %s" msg
| Ok p ->
let decl_map = Typeck.get_decl_map p in
Hashtbl.iter
(fun name ty -> Printf.eprintf " %s : %s\n" name (Ast.show_ty ty))
decl_map;
Ast.show_program p |> print_endline