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

@@ -1213,11 +1213,11 @@ State 1
3 num: '0' .
4 id: '0' .
Example: '0' .
First derivation
First reduce derivation
exp
`-> num
`-> '0' .
Second derivation
Second reduce derivation
exp
`-> id
`-> '0' .
@@ -1807,10 +1807,10 @@ State 5
8 reported_conflicts: 'a' .
9 reported_conflicts: 'a' .
Example: 'a' .
First derivation
First reduce derivation
reported_conflicts
`-> 'a' .
Second derivation
Second reduce derivation
reported_conflicts
`-> 'a' .
@@ -1997,11 +1997,11 @@ AT_CHECK([[cat input.output | sed -n '/^State 0$/,/^State 1$/p']], 0,
12 empty_c2: . %empty
13 empty_c3: . %empty
Example: . 'c'
First derivation
First reduce derivation
start
`-> empty_c2 'c'
`-> .
Second derivation
Second reduce derivation
start
`-> empty_c3 'c'
`-> .