Commit 6ce61536 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

In --infer mode, leave the .ml file around if ocamlc fails.

parent 88656f37
In --infer mode, leave the .ml file around (instead of removing it) if
ocamlc fails, so we have a chance to understand what's wrong.
Re-established some error messages concerning the mis-use of $i which
had disappeared on 2015/06/29.
......@@ -304,10 +304,16 @@ let infer grammar =
let output =
Option.project (
IO.with_file mlname (write grammar) (fun () ->
IO.invoke ocamlc_command
write grammar ();
match IO.invoke ocamlc_command with
| Some result ->
Sys.remove mlname;
| None ->
(* 2015/10/05: intentionally do not remove the [.ml] file if [ocamlc]
fails. (Or if an exception is thrown.) We cannot understand why
[ocaml] complains if we can't see the [.ml] file. *)
exit 1
(* Make sense out of ocamlc's output. *)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment