2022-01-10 01:31:47 +09:00
|
|
|
(* simple REPL *)
|
|
|
|
let rec repl () : unit =
|
|
|
|
Printf.printf "> ";
|
|
|
|
let line = read_line () in
|
|
|
|
if line <> "quit" then begin
|
|
|
|
line
|
|
|
|
|> Lex.tokenize
|
|
|
|
|> Parser.parse
|
|
|
|
|> Eval.eval
|
2022-01-10 23:11:13 +09:00
|
|
|
|> Ast.typ_to_string
|
|
|
|
|> Printf.printf "%s\n";
|
2022-01-10 01:31:47 +09:00
|
|
|
repl ()
|
|
|
|
end
|
|
|
|
|
|
|
|
let () = repl ()
|