cex: use usual routines for diagnostics about S/R conflicts

See previous commit.  We go from

    input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
    Shift/reduce conflict on token "⊕":
      Example              exp "+" exp • "⊕" exp
      Shift derivation
        exp
        ↳ exp "+" exp
                  ↳ exp • "⊕" exp

to

    input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
    input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
      Example              exp "+" exp • "⊕" exp
      Shift derivation
        exp
        ↳ exp "+" exp
                  ↳ exp • "⊕" exp

with an hyperlink on -Wcounterexamples.

* src/counterexample.c (counterexample_report_shift_reduce):
Use complain.
* tests/counterexample.at, tests/diagnostics.at, tests/report.at:
Adjust.
This commit is contained in:
Akim Demaille
2020-07-19 19:34:34 +02:00
parent 9922f1f877
commit ea138cd1f1
5 changed files with 60 additions and 53 deletions

View File

@@ -861,7 +861,7 @@ State 5
OP [reduce using rule 1 (exp)]
$default reduce using rule 1 (exp)
Shift/reduce conflict on token OP:
shift/reduce conflict on token OP:
1 exp: exp OP exp .
1 exp: exp . OP exp
Example exp OP exp . OP exp
@@ -1764,7 +1764,7 @@ State 4
reported_conflicts go to state 6
Shift/reduce conflict on token 'a':
shift/reduce conflict on token 'a':
10 reported_conflicts: . %empty
8 reported_conflicts: . 'a'
First example resolved_conflict . 'a' 'a'
@@ -1778,7 +1778,7 @@ State 4
`-> resolved_conflict reported_conflicts 'a'
`-> .
Shift/reduce conflict on token 'a':
shift/reduce conflict on token 'a':
10 reported_conflicts: . %empty
9 reported_conflicts: . 'a'
First example resolved_conflict . 'a' 'a'