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

View File

@@ -2,6 +2,7 @@ examples/c/bistromathic/parse.y
examples/java/calc/Calc.y
src/complain.c
src/conflicts.c
src/counterexample.c
src/files.c
src/fixits.c
src/getargs.c