mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 04:43:03 +00:00
* src/symtab.h (SUNDEF): New.
* src/symtab.c (bucket_new): Init user_token_number to SUNDEF to stand for `uninitialized', instead of 0. * src/reader.c (packsymbols, parse_thong_decl): Adjust. * src/lex.c (lex): Adjust. * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF. Number it 0. Let yylex return it instead of a plain 0. Reported by Dick Streefland.
This commit is contained in:
@@ -724,7 +724,6 @@ token_buffer);
|
||||
}
|
||||
|
||||
prev = t;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -852,7 +851,7 @@ parse_thong_decl (void)
|
||||
token_t token;
|
||||
struct bucket *symbol;
|
||||
char *typename = 0;
|
||||
int usrtoknum = 0;
|
||||
int usrtoknum = SUNDEF;
|
||||
|
||||
token = lex (); /* fetch typename or first token */
|
||||
if (token == tok_typename)
|
||||
@@ -1724,6 +1723,9 @@ token_translations_init (void)
|
||||
/* A token string alias? */
|
||||
if (bp->user_token_number == SALIAS)
|
||||
continue;
|
||||
|
||||
assert (bp->user_token_number != SUNDEF);
|
||||
|
||||
/* A token which translation has already been set? */
|
||||
if (token_translations[bp->user_token_number] != 2)
|
||||
complain (_("tokens %s and %s both assigned number %d"),
|
||||
@@ -1810,7 +1812,7 @@ packsymbols (void)
|
||||
|
||||
if (bp->class == token_sym)
|
||||
{
|
||||
if (bp->user_token_number == 0)
|
||||
if (bp->user_token_number == SUNDEF)
|
||||
bp->user_token_number = ++last_user_token_number;
|
||||
if (bp->user_token_number > max_user_token_number)
|
||||
max_user_token_number = bp->user_token_number;
|
||||
|
||||
Reference in New Issue
Block a user