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:
Akim Demaille
2018-11-27 21:07:21 +01:00
parent d92ed9d9f7
commit 2c5e933672
4 changed files with 63 additions and 37 deletions

View File

@@ -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);
}
;