Commit 26b2cb27 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

When [--infer-read-reply] is set, suppress all output until the [.mli] file is read.

This avoids a duplication of the output when [--infer-write-query]
and [--infer-read-reply] are used one after the other.
parent 9394287c
......@@ -28,6 +28,26 @@ let disable () =
(* ---------------------------------------------------------------------------- *)
(* The new OCaml type inference protocol means that Menhir is called twice, first
with [--infer-write-query], then with [--infer-read-reply]. This means that any
information messages or warnings issued before OCaml type inference takes place
are duplicated, unless we do something about it. To address this issue, when
[--infer-read-reply] is set, we disable all output until the point where we
read the inferred [.mli] file. Then, we enable it again and continue. *)
(* An alternative idea would be to disable all output when [--infer-write-query]
is set. However, we would then have no output at all if this command fails. *)
let () =
Settings.(match infer with
| IMReadReply _ ->
| _ ->
(* ---------------------------------------------------------------------------- *)
(* Logging and log levels. *)
let log kind verbosity msg =
......@@ -310,6 +310,9 @@ let depend postprocess grammar =
let read_reply (output : string) grammar =
(* See comment in module [Error]. *)
let env : (string * int * int) list =
Lexmli.main (Lexing.from_string 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