mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 05:13:04 +00:00
diagnostics: no longer pretty-print rules in error messages, carets suffice
* src/gram.c (grammar_rules_useless_report): Let -fcaret handle the pretty-printing of the guilty rules. (rule_print): Inline in its only use. * tests/conflicts.at, tests/existing.at, tests/reduce.at, * tests/regression.at: Adjust. * NEWS: Document.
This commit is contained in:
33
src/gram.c
33
src/gram.c
@@ -125,13 +125,6 @@ rule_rhs_print_xml (rule const *r, FILE *out, int level)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
rule_print (rule const *r, FILE *out)
|
||||
{
|
||||
fprintf (out, "%s:", r->lhs->tag);
|
||||
rule_rhs_print (r, out);
|
||||
}
|
||||
|
||||
void
|
||||
ritem_print (FILE *out)
|
||||
{
|
||||
@@ -289,8 +282,8 @@ grammar_dump (FILE *out, const char *title)
|
||||
rule_number r;
|
||||
for (r = 0; r < nrules + nuseless_productions; r++)
|
||||
{
|
||||
fprintf (out, "%-5d ", r);
|
||||
rule_print (&rules[r], out);
|
||||
fprintf (out, "%-5d %s:", r, rules[r].lhs->tag);
|
||||
rule_rhs_print (&rules[r], out);
|
||||
fprintf (out, "\n");
|
||||
}
|
||||
}
|
||||
@@ -300,24 +293,10 @@ grammar_dump (FILE *out, const char *title)
|
||||
void
|
||||
grammar_rules_useless_report (const char *message)
|
||||
{
|
||||
warnings w = Wother;
|
||||
if (warnings_flag & w)
|
||||
{
|
||||
rule_number r;
|
||||
for (r = 0; r < nrules ; ++r)
|
||||
if (!rules[r].useful)
|
||||
{
|
||||
if (feature_flag & feature_caret)
|
||||
complain (&rules[r].location, w, "%s", message);
|
||||
else
|
||||
{
|
||||
complain (&rules[r].location, w | silent, "%s: ", message);
|
||||
rule_print (&rules[r], stderr);
|
||||
warnings_print_categories (w);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
rule_number r;
|
||||
for (r = 0; r < nrules ; ++r)
|
||||
if (!rules[r].useful)
|
||||
complain (&rules[r].location, Wother, "%s", message);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user