e0/bin/main.ml

13 lines
369 B
OCaml
Raw Normal View History

2022-03-08 06:16:27 +00:00
open E0
let () =
let p = Lexing.from_channel stdin |> Parse.try_parse in
2022-03-08 08:52:20 +00:00
match p with
| Error msg -> Printf.eprintf "Could not load program: %s" msg
2022-03-23 06:12:37 +00:00
| 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