diagnostics: better location for type redeclarations
commitcb655534494201ff80af8adc885ae46998fcb6b3
authorAkim Demaille <akim.demaille@gmail.com>
Sat, 1 Aug 2020 06:51:24 +0000 (1 08:51 +0200)
committerAkim Demaille <akim.demaille@gmail.com>
Sat, 1 Aug 2020 06:54:46 +0000 (1 08:54 +0200)
tree3f85a612a2a990fa8ae3981f73b3e1c53b7bf932
parentf47a1bd622b8aee8838ae56cea296f2ee99c4ad1
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.
NEWS
src/parse-gram.y
src/symlist.c
src/symlist.h
tests/input.at