ce/main.ml
2022-01-10 23:27:37 +09:00

14 lines
256 B
OCaml

(* 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
|> Printf.printf "%d\n";
repl ()
end
let () = repl ()