mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 18:53:04 +00:00
style changes
* src/complain.c, src/reader.c, src/reduce.c, src/main.c: Fix indentation. Simplify a bit.
This commit is contained in:
committed by
Akim Demaille
parent
415b88231a
commit
5ff5cf6700
@@ -115,10 +115,8 @@ complains (const location *loc, warnings flags, const char *message,
|
|||||||
error_message (loc, flags, _("warning"), message, args);
|
error_message (loc, flags, _("warning"), message, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (warnings_flag & flags)
|
||||||
{
|
{
|
||||||
if (! (warnings_flag & flags))
|
|
||||||
return;
|
|
||||||
set_warning_issued ();
|
set_warning_issued ();
|
||||||
error_message (loc, flags, _("warning"), message, args);
|
error_message (loc, flags, _("warning"), message, args);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,14 +303,15 @@ grammar_dump (FILE *out, const char *title)
|
|||||||
|
|
||||||
void
|
void
|
||||||
grammar_rules_useless_report (const char *message)
|
grammar_rules_useless_report (const char *message)
|
||||||
|
{
|
||||||
|
warnings w = Wother;
|
||||||
|
if (warnings_flag & w)
|
||||||
{
|
{
|
||||||
rule_number r;
|
rule_number r;
|
||||||
for (r = 0; r < nrules ; ++r)
|
for (r = 0; r < nrules ; ++r)
|
||||||
if (!rules[r].useful)
|
if (!rules[r].useful)
|
||||||
{
|
{
|
||||||
complain_at (rules[r].location, Wother, "%s: ", message);
|
complain_at (rules[r].location, w, "%s: ", message);
|
||||||
if (warnings_flag & Wother)
|
|
||||||
{
|
|
||||||
rule_print (&rules[r], stderr);
|
rule_print (&rules[r], stderr);
|
||||||
fflush (stderr);
|
fflush (stderr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,8 +142,7 @@ main (int argc, char *argv[])
|
|||||||
tables_generate ();
|
tables_generate ();
|
||||||
timevar_pop (TV_ACTIONS);
|
timevar_pop (TV_ACTIONS);
|
||||||
|
|
||||||
grammar_rules_useless_report
|
grammar_rules_useless_report (_("rule useless in parser due to conflicts"));
|
||||||
(_("rule useless in parser due to conflicts"));
|
|
||||||
|
|
||||||
/* Output file names. */
|
/* Output file names. */
|
||||||
compute_output_file_names ();
|
compute_output_file_names ();
|
||||||
|
|||||||
@@ -319,8 +319,7 @@ grammar_rule_check (const symbol_list *r)
|
|||||||
/* The default action, $$ = $1, `uses' both. */
|
/* The default action, $$ = $1, `uses' both. */
|
||||||
&& (r->action_props.code || (n != 0 && n != 1)))
|
&& (r->action_props.code || (n != 0 && n != 1)))
|
||||||
{
|
{
|
||||||
int warn_flag =
|
warnings warn_flag = midrule_warning ? Wmidrule_values : Wother;
|
||||||
midrule_warning ? Wmidrule_values : Wother;
|
|
||||||
if (n)
|
if (n)
|
||||||
complain_at (r->location, warn_flag, _("unused value: $%d"), n);
|
complain_at (r->location, warn_flag, _("unused value: $%d"), n);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -432,8 +432,8 @@ reduce_grammar (void)
|
|||||||
{
|
{
|
||||||
grammar_dump (stderr, "Reduced Grammar");
|
grammar_dump (stderr, "Reduced Grammar");
|
||||||
|
|
||||||
fprintf (stderr, "reduced %s defines %d terminals, %d nonterminals\
|
fprintf (stderr, "reduced %s defines %d terminals, %d nonterminals"
|
||||||
, and %d productions.\n",
|
", and %d productions.\n",
|
||||||
grammar_file, ntokens, nvars, nrules);
|
grammar_file, ntokens, nvars, nrules);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user