mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
diagnostics: better location for type redeclarations
From
foo.y:1.7-11: error: %type redeclaration for bar
1 | %type <foo> bar bar
| ^~~~~
foo.y:1.7-11: note: previous declaration
1 | %type <foo> bar bar
| ^~~~~
to
foo.y:1.17-19: error: %type redeclaration for bar
1 | %type <foo> bar bar
| ^~~
foo.y:1.13-15: note: previous declaration
1 | %type <foo> bar bar
| ^~~
* src/symlist.h, src/symlist.c (symbol_list_type_set): There's no need
for the tag's location, use that of the symbol.
* src/parse-gram.y: Adjust.
* tests/input.at: Adjust.
This commit is contained in:
@@ -1252,12 +1252,12 @@ AT_TEST([[%token foo "foo"
|
||||
%%
|
||||
exp: foo;
|
||||
]],
|
||||
[[input.y:3.7-11: error: %type redeclaration for foo
|
||||
[[input.y:3.13-15: error: %type redeclaration for foo
|
||||
3 | %type <baz> foo
|
||||
| ^~~~~
|
||||
input.y:2.7-11: note: previous declaration
|
||||
| ^~~
|
||||
input.y:2.13-17: note: previous declaration
|
||||
2 | %type <bar> "foo"
|
||||
| ^~~~~
|
||||
| ^~~~~
|
||||
]])
|
||||
|
||||
AT_TEST([[%token foo "foo"
|
||||
|
||||
Reference in New Issue
Block a user