Modifications mineures du TP Menhir
This commit is contained in:
parent
475b52957b
commit
aaed324c5e
4 changed files with 8 additions and 8 deletions
|
@ -1,2 +1,2 @@
|
||||||
(lang dune 1.4)
|
(lang dune 1.11)
|
||||||
(using menhir 2.0)
|
(using menhir 2.0)
|
||||||
|
|
BIN
tp/tp-menhir/code/marthe
Executable file
BIN
tp/tp-menhir/code/marthe
Executable file
Binary file not shown.
|
@ -1,12 +1,12 @@
|
||||||
let rec interactive_loop () =
|
let rec interactive_loop () =
|
||||||
welcome_message ();
|
welcome_message ();
|
||||||
let rec loop () =
|
let rec loop () =
|
||||||
begin try
|
try
|
||||||
read () |> eval |> print
|
read () |> eval |> print
|
||||||
with exn ->
|
with End_of_file -> print_newline ()
|
||||||
Printf.printf "Error: %s\n%!" (Printexc.to_string exn)
|
| exn ->
|
||||||
end;
|
Printf.printf "Error: %s\n%!" (Printexc.to_string exn);
|
||||||
loop ()
|
loop ()
|
||||||
in
|
in
|
||||||
loop ()
|
loop ()
|
||||||
|
|
||||||
|
@ -18,9 +18,9 @@ and welcome_message () =
|
||||||
"
|
"
|
||||||
|
|
||||||
and read () =
|
and read () =
|
||||||
invite (); input_line stdin |> parse
|
prompt (); input_line stdin |> parse
|
||||||
|
|
||||||
and invite () =
|
and prompt () =
|
||||||
Printf.printf "> %!"
|
Printf.printf "> %!"
|
||||||
|
|
||||||
and parse input =
|
and parse input =
|
||||||
|
|
Binary file not shown.
Reference in a new issue