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

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

parent 88656f37
2015/10/05:
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.
2015/09/21: 2015/09/21:
Re-established some error messages concerning the mis-use of $i which Re-established some error messages concerning the mis-use of $i which
had disappeared on 2015/06/29. had disappeared on 2015/06/29.
......
...@@ -304,10 +304,16 @@ let infer grammar = ...@@ -304,10 +304,16 @@ let infer grammar =
in in
let output = let output =
Option.project ( write grammar ();
IO.with_file mlname (write grammar) (fun () -> match IO.invoke ocamlc_command with
IO.invoke ocamlc_command | Some result ->
)) Sys.remove mlname;
result
| 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
in in
(* Make sense out of ocamlc's output. *) (* 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