cex: label all the derivations by their initial action

From

    input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
      Example: A b .
      First derivation
        a
        `-> A b .
      Second derivation
        a
        `-> A b
              `-> b .

to

    input.y: warning: reduce/reduce conflict on token $end [-Wcounterexamples]
      Example: A b .
      First reduce derivation
        a
        `-> A b .
      Second reduce derivation
        a
        `-> A b
              `-> b .

* src/counterexample.c (print_counterexample): here.
Compute the width of the labels to properly align the values.
* tests/conflicts.at, tests/counterexample.at, tests/diagnostics.at,
* tests/report.at: Adjust.
This commit is contained in:
Akim Demaille
2020-07-20 07:14:50 +02:00
parent b81229e1f9
commit b8c5e5609f
5 changed files with 163 additions and 134 deletions

View File

@@ -1549,10 +1549,10 @@ input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
↳ exp "+" exp •
input.y: warning: reduce/reduce conflict on tokens $end, "+", "⊕" [-Wcounterexamples]
Example: exp "+" exp •
First derivation
First reduce derivation
exp
↳ exp "+" exp •
Second derivation
Second reduce derivation
exp
↳ exp "+" exp •
input.y: warning: shift/reduce conflict on token "⊕" [-Wcounterexamples]
@@ -1756,10 +1756,10 @@ State 7
2 exp: exp "+" exp •
3 exp: exp "+" exp •
Example: exp "+" exp •
First derivation
First reduce derivation
exp
↳ exp "+" exp •
Second derivation
Second reduce derivation
exp
↳ exp "+" exp •