Convert multiple variable definition warnings to complaints.

* NEWS (2.5): Add a new entry for that change.
* doc/bison.texinfo (Decl Summary): Update %define entry.
(Bison Options): Update -D/--define/-F/--force-define entry.
* src/muscle_tab.c (muscle_percent_define_insert): Implement.
* src/muscle_tab.h (muscle_percent_define_insert): Update
comments.
* tests/input.at (`%define errors'): Update.
(`%define, --define, --force-define'): Update.
This commit is contained in:
Joel E. Denny
2009-05-23 02:25:28 -04:00
parent 34d4193815
commit e3a33f7c23
6 changed files with 62 additions and 35 deletions

View File

@@ -436,9 +436,9 @@ muscle_percent_define_insert (char const *variable, location variable_loc,
free (variable_tr);
return;
}
warn_at (variable_loc, _("%s `%s' redefined"),
"%define variable", variable);
warn_at (muscle_percent_define_get_loc (variable),
complain_at (variable_loc, _("%s `%s' redefined"),
"%define variable", variable);
complain_at (muscle_percent_define_get_loc (variable),
_("previous definition"));
}

View File

@@ -133,7 +133,7 @@ typedef enum {
/* Define the muscles for %define variable VARIABLE with VALUE specified
at VARIABLE_LOC in the manner HOW unless it was specified in the
grammar file while the previous definition for VARIABLE was specified
with -F/--force-define. Warn if a previous definition is being
with -F/--force-define. Complain if a previous definition is being
overridden and the new definition is specified in the grammar file.
(These rules support the documented behavior as long as command-line
definitions are processed before grammar file definitions.) Record