15 lines
256 B
OCaml
15 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 ()
|