Commit a252433e authored by POTTIER Francois's avatar POTTIER Francois

When `--explain` is enabled, always create a fresh `.conflicts` file

(wiping out any pre-existing file), even if there are in fact no conflicts.
parent c2eff1e2
# Changes
## 2018/09/05
* When `--explain` is enabled, always create a fresh `.conflicts` file
(wiping out any pre-existing file), even if there are in fact no conflicts.
This should avoid confusion with outdated `.conflicts` files.
* Fix several bugs in the treatment of `--strict`. No `.conflicts` file
was created when `--strict` and `--explain` were both enabled. Also,
some warnings were not properly turned into errors by `--strict`.
## 2018/07/04
* Update the `man` page, which was woefully out of date.
......
* Fix all uses of Error.signal/Error.exit
by making sure all uses of signal are followed with a call to exit
and by avoiding global state.
Make sure --strict (grammar_warning) works.
Make sure --explain --strict creates a .conflicts file.
* Incremental API: expose a function `lookahead` of type `'a env -> token option`.
* Do not host the .tar.gz archive on yquem. Look into gitlab.inria.fr.
......@@ -227,9 +221,6 @@
* BUG: cutdown.mly
* le fichier .conflicts devrait etre supprime par --explain s'il
n'y a aucun conflit
* dans le dump de l'automate, rajouter les transitions qui ont
ete supprimees par resolution de conflits. Afficher aussi les
réductions par défaut?
......
......@@ -18,12 +18,6 @@ let () =
DependencyGraph.print_dependency_graph()
(* artificial dependency *)
(* -------------------------------------------------------------------------- *)
(* Our output channel. *)
let out =
lazy (open_out (Settings.base ^ ".conflicts"))
(* -------------------------------------------------------------------------- *)
(* Explaining shift actions. *)
......@@ -352,6 +346,15 @@ let explain_reduce_item
let () =
if Settings.explain then begin
(* 2018/09/05: when [--explain] is enabled, always create a fresh
.conflicts file (wiping out any pre-existing file), even if
there are in fact no conflicts. This should avoid confusion with
outdated .conflicts files. *)
let out =
open_out (Settings.base ^ ".conflicts")
in
Lr1.conflicts (fun toks node ->
try
......@@ -400,8 +403,6 @@ let () =
(* Explain how the conflict state is reached. *)
let out = Lazy.force out in
Printf.fprintf out "\n\
** Conflict (%s) in state %d.\n\
** Token%s involved: %s\n%s\
......@@ -494,8 +495,6 @@ let () =
or because [--lalr] was enabled and we have unexplainable LALR conflicts.
Anyway, send the error message to the .conflicts file and continue. *)
let out = Lazy.force out in
Printf.fprintf out "\n\
** Conflict (unexplainable) in state %d.\n\
** Token%s involved: %s\n\
......
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