small-set-of-ml/bin/main.ml
2025-01-29 18:07:47 +09:00

13 lines
No EOL
249 B
OCaml

open Calc;;
let main () =
let input = Sys.argv.(1) in
let _ = Printf.printf "input: %s\n" input in
let result = Eval.eval_str input in
match result with
| Eval.Int n -> Printf.printf "%d\n" n
| _ -> failwith "Type error"
;;
main ();;