mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
warnings: fusion of complain and complain_at
These functions are very similar, and keeping them seperate makes future improvements difficult, so merge them. This impacts 89 calls. * src/bootstrap.conf: Adjust. * src/complain.c (complain, complain_at): Merge into... (complain): this. (complain_args): Adjust. * src/complain.h, src/conflicts.c, src/files.c, src/getargs.c, * src/gram.c, src/location.c, src/muscle-tab.c, src/parse-gram.y, * src/reader.c, src/reduce.c, src/scan-code.l, src/scan-gram.l, * src/scan-skel.l, src/symlist.c, src/symtab.c: Adjust. Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
This commit is contained in:
committed by
Akim Demaille
parent
a49f4904c3
commit
bb8e56ff67
24
src/reduce.c
24
src/reduce.c
@@ -299,9 +299,9 @@ nonterminals_reduce (void)
|
||||
{
|
||||
nontermmap[i - ntokens] = n++;
|
||||
if (symbols[i]->status != used)
|
||||
complain_at (symbols[i]->location, Wother,
|
||||
_("nonterminal useless in grammar: %s"),
|
||||
symbols[i]->tag);
|
||||
complain (&symbols[i]->location, Wother,
|
||||
_("nonterminal useless in grammar: %s"),
|
||||
symbols[i]->tag);
|
||||
}
|
||||
|
||||
|
||||
@@ -383,14 +383,14 @@ static void
|
||||
reduce_print (void)
|
||||
{
|
||||
if (nuseless_nonterminals > 0)
|
||||
complain (Wother, ngettext ("%d nonterminal useless in grammar",
|
||||
"%d nonterminals useless in grammar",
|
||||
nuseless_nonterminals),
|
||||
complain (NULL, Wother, ngettext ("%d nonterminal useless in grammar",
|
||||
"%d nonterminals useless in grammar",
|
||||
nuseless_nonterminals),
|
||||
nuseless_nonterminals);
|
||||
if (nuseless_productions > 0)
|
||||
complain (Wother, ngettext ("%d rule useless in grammar",
|
||||
"%d rules useless in grammar",
|
||||
nuseless_productions),
|
||||
complain (NULL, Wother, ngettext ("%d rule useless in grammar",
|
||||
"%d rules useless in grammar",
|
||||
nuseless_productions),
|
||||
nuseless_productions);
|
||||
}
|
||||
|
||||
@@ -416,9 +416,9 @@ reduce_grammar (void)
|
||||
reduce_print ();
|
||||
|
||||
if (!bitset_test (N, accept->number - ntokens))
|
||||
complain_at (startsymbol_location, fatal,
|
||||
_("start symbol %s does not derive any sentence"),
|
||||
startsymbol->tag);
|
||||
complain (&startsymbol_location, fatal,
|
||||
_("start symbol %s does not derive any sentence"),
|
||||
startsymbol->tag);
|
||||
|
||||
/* First reduce the nonterminals, as they renumber themselves in the
|
||||
whole grammar. If you change the order, nonterms would be
|
||||
|
||||
Reference in New Issue
Block a user