cex: reformat the s/r and r/r reports

In Bison we refer to "shift/reduce" conflicts, not "shift-reduce" (in
Bison 3.6.3 186 occurrences vs 15).  Enforce consistency on this.

Instead of "spending" a second line for each conflict to report the
lookaheads, put that on the same line as the type of conflict.  Also,
prefer "token" to "symbol".  Maybe we should even prefer "lookahead".
While at it, enable internationalization, with plurals where
appropriate.

As a consequence, instead of

    Shift-Reduce Conflict:
    6:    3 b: . %empty
    6:    6 d: c . A
    On Symbol: A

display

    Shift/reduce conflict on token A:
    6:    3 b: . %empty
    6:    6 d: c . A

* NEWS, doc/bison.texi, src/conflicts.c: Spell it "shift/reduce", not
"shift-reduce".
* src/counterexample.c (counterexample_report_shift_reduce)
(counterexample_report_reduce_reduce): Reformat and internationalize
output.
* tests/counterexample.at: Adjust expectations.
This commit is contained in:
Akim Demaille
2020-06-07 07:32:59 +02:00
parent 421662ec88
commit 1ccb4be02b
6 changed files with 61 additions and 81 deletions

6
NEWS
View File

@@ -848,11 +848,11 @@ GNU Bison NEWS
...
Looking at the output from -v, one can see that the shift-reduce conflict
Looking at the output from -v, one can see that the shift/reduce conflict
here is due to the fact that the parser does not know whether to reduce
arguments to argument_list until it sees the token _after_ the following
','. By marking the rule with %expect 1 (because there is a conflict in
one state), we document the source of the 1 overall shift-reduce conflict.
one state), we document the source of the 1 overall shift/reduce conflict.
In GLR parsers, we can use %expect-rr in a rule for reduce/reduce
conflicts. In this case, we mark each of the conflicting rules. For
@@ -967,7 +967,7 @@ GNU Bison NEWS
** Bug fixes
*** Incorrect number of reduce-reduce conflicts
*** Incorrect number of reduce/reduce conflicts
On a grammar such as