mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 05:13:04 +00:00
Let symbols have a location.
* src/symtab.h, src/symtab.c (symbol_t): Location is a new member. (getsym): Adjust. Adjust all callers. * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at): Use location_t, not int. * src/symtab.c (symbol_check_defined): Take advantage of the location. * tests/regression.at (Invalid inputs): Adjust.
This commit is contained in:
@@ -59,6 +59,9 @@ struct symbol_s
|
||||
/* Its type. */
|
||||
char *type_name;
|
||||
|
||||
/* The location of its first occurence. */
|
||||
location_t location;
|
||||
|
||||
symbol_number_t number;
|
||||
short prec;
|
||||
associativity assoc;
|
||||
@@ -85,7 +88,7 @@ struct symbol_s
|
||||
|
||||
|
||||
/* Fetch (or create) the symbol associated to KEY. */
|
||||
symbol_t *getsym PARAMS ((const char *key));
|
||||
symbol_t *getsym PARAMS ((const char *key, location_t location));
|
||||
|
||||
/* Declare the new SYMBOL. Make it an alias of SYMVAL. */
|
||||
void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval));
|
||||
|
||||
Reference in New Issue
Block a user