mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 13:53:03 +00:00
parser: improve location of string alias errors
* src/parse-gram.y (symbol_def): Pass the right location for symbol_make_alias. * tests/regression.at (Duplicate string): Move to... * tests/input.at: here. (Token collisions): New.
This commit is contained in:
@@ -530,7 +530,7 @@ symbol_def:
|
||||
}
|
||||
symbol_class_set ($1, current_class, @1, true);
|
||||
symbol_type_set ($1, current_type, @1);
|
||||
symbol_make_alias ($1, $2, @$);
|
||||
symbol_make_alias ($1, $2, @2);
|
||||
}
|
||||
| id INT string_as_id
|
||||
{
|
||||
@@ -545,7 +545,7 @@ symbol_def:
|
||||
symbol_class_set ($1, current_class, @1, true);
|
||||
symbol_type_set ($1, current_type, @1);
|
||||
symbol_user_token_number_set ($1, $2, @2);
|
||||
symbol_make_alias ($1, $3, @$);
|
||||
symbol_make_alias ($1, $3, @3);
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
@@ -462,9 +462,7 @@ symbol_class_set (symbol *sym, symbol_class class, location loc, bool declaring)
|
||||
void
|
||||
symbol_user_token_number_set (symbol *sym, int user_token_number, location loc)
|
||||
{
|
||||
int *user_token_numberp;
|
||||
|
||||
user_token_numberp = &sym->content->user_token_number;
|
||||
int *user_token_numberp = &sym->content->user_token_number;
|
||||
if (*user_token_numberp != USER_NUMBER_UNDEFINED
|
||||
&& *user_token_numberp != user_token_number)
|
||||
complain (&loc, complaint, _("redefining user token number of %s"),
|
||||
|
||||
Reference in New Issue
Block a user