mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
@@ -1248,8 +1248,15 @@ counterexample_report_shift_reduce (state_item_number itm1, state_item_number it
|
||||
symbol_number next_sym,
|
||||
FILE *out, const char *prefix)
|
||||
{
|
||||
fputs (prefix, out);
|
||||
fprintf (out, _("Shift/reduce conflict on token %s:\n"), symbols[next_sym]->tag);
|
||||
if (out == stderr)
|
||||
complain (NULL, Wcounterexamples,
|
||||
_("shift/reduce conflict on token %s"), symbols[next_sym]->tag);
|
||||
else
|
||||
{
|
||||
fputs (prefix, out);
|
||||
fprintf (out, _("shift/reduce conflict on token %s"), symbols[next_sym]->tag);
|
||||
fprintf (out, "%s\n", _(":"));
|
||||
}
|
||||
// In the report, print the items.
|
||||
if (*prefix || trace_flag & trace_cex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user