13 lines
No EOL
249 B
OCaml
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 ();; |