mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 23:33:03 +00:00
* src/muscle_tab.c (muscle_percent_define_flag_if): In order to
determine whether this function has already complained about an invalid value for a %define boolean variable, don't check whether Bison has ever examined the value. As written, the check was a tautology. Instead, record and check for this complaint using a separate muscle.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
|
||||||
|
|
||||||
|
* src/muscle_tab.c (muscle_percent_define_flag_if): In order to
|
||||||
|
determine whether this function has already complained about an invalid
|
||||||
|
value for a %define boolean variable, don't check whether Bison has
|
||||||
|
ever examined the value. As written, the check was a tautology.
|
||||||
|
Instead, record and check for this complaint using a separate muscle.
|
||||||
|
|
||||||
2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
|
2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
|
||||||
|
|
||||||
Fix push parsing memory leak reported by Brandon Lucia at
|
Fix push parsing memory leak reported by Brandon Lucia at
|
||||||
|
|||||||
@@ -460,12 +460,15 @@ muscle_percent_define_flag_if (char const *variable)
|
|||||||
char const *name;
|
char const *name;
|
||||||
char const *loc_name;
|
char const *loc_name;
|
||||||
char const *usage_name;
|
char const *usage_name;
|
||||||
|
char const *invalid_boolean_name;
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
MUSCLE_USER_NAME_CONVERT (name, "percent_define(", variable, ")");
|
MUSCLE_USER_NAME_CONVERT (name, "percent_define(", variable, ")");
|
||||||
MUSCLE_USER_NAME_CONVERT (loc_name, "percent_define_loc(", variable, ")");
|
MUSCLE_USER_NAME_CONVERT (loc_name, "percent_define_loc(", variable, ")");
|
||||||
MUSCLE_USER_NAME_CONVERT (usage_name, "percent_define_bison_variables(",
|
MUSCLE_USER_NAME_CONVERT (usage_name, "percent_define_bison_variables(",
|
||||||
variable, ")");
|
variable, ")");
|
||||||
|
MUSCLE_USER_NAME_CONVERT (invalid_boolean_name,
|
||||||
|
"percent_define_invalid_boolean(", variable, ")");
|
||||||
|
|
||||||
if (muscle_percent_define_ifdef (variable))
|
if (muscle_percent_define_ifdef (variable))
|
||||||
{
|
{
|
||||||
@@ -474,10 +477,13 @@ muscle_percent_define_flag_if (char const *variable)
|
|||||||
result = true;
|
result = true;
|
||||||
else if (0 == strcmp (value, "false"))
|
else if (0 == strcmp (value, "false"))
|
||||||
result = false;
|
result = false;
|
||||||
else if (!muscle_find_const (usage_name))
|
else if (!muscle_find_const (invalid_boolean_name))
|
||||||
complain_at(muscle_location_decode (loc_name),
|
{
|
||||||
_("invalid value for %%define boolean variable `%s'"),
|
muscle_insert (invalid_boolean_name, "");
|
||||||
variable);
|
complain_at(muscle_location_decode (loc_name),
|
||||||
|
_("invalid value for %%define boolean variable `%s'"),
|
||||||
|
variable);
|
||||||
|
}
|
||||||
free (value);
|
free (value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user