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:
Akim Demaille
2020-08-01 08:51:24 +02:00
parent f47a1bd622
commit cb65553449
5 changed files with 21 additions and 14 deletions

8
NEWS
View File

@@ -2,8 +2,16 @@ GNU Bison NEWS
* Noteworthy changes in release ?.? (????-??-??) [?]
** Bug fixes
Fixed a crash when a token alias contains a NUL byte.
** Changes
Improvements and fixes in the documentation.
More precise location about symbol type redefinitions.
* Noteworthy changes in release 3.7 (2020-07-23) [stable]