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:
Akim Demaille
2002-06-15 18:21:46 +00:00
parent 8efe435c05
commit ee000ba4fc
11 changed files with 74 additions and 60 deletions

View File

@@ -154,7 +154,7 @@ blanks [ \t\f]+
{eols} YY_LINES; YY_STEP;
{blanks} YY_STEP;
{id} {
yylval->symbol = getsym (yytext);
yylval->symbol = getsym (yytext, *yylloc);
return ID;
}
@@ -286,7 +286,7 @@ blanks [ \t\f]+
assert (yy_top_state () == INITIAL);
{
YY_OBS_FINISH;
yylval->symbol = getsym (last_string);
yylval->symbol = getsym (last_string, *yylloc);
symbol_class_set (yylval->symbol, token_sym);
symbol_user_token_number_set (yylval->symbol, last_string[1]);
YY_OBS_FREE;