mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
* src/symtab.c (symbol_user_token_number_set): Don't complain when
assigning twice the same user number to a token, so that we can use it in... * src/lex.c (lex): here. Also use `symbol_class_set' instead of hand written code. * src/reader.c (parse_assoc_decl): Likewise.
This commit is contained in:
10
src/reader.c
10
src/reader.c
@@ -656,13 +656,7 @@ parse_assoc_decl (associativity assoc)
|
||||
break;
|
||||
|
||||
case tok_identifier:
|
||||
if (symval->class == nterm_sym)
|
||||
complain (_("symbol %s redefined"), symval->tag);
|
||||
if (symval->number == NUMBER_UNDEFINED)
|
||||
{
|
||||
symval->number = ntokens++;
|
||||
symval->class = token_sym;
|
||||
}
|
||||
symbol_class_set (symval, token_sym);
|
||||
symbol_precedence_set (symval, lastprec, assoc);
|
||||
if (name)
|
||||
symbol_type_set (symval, name);
|
||||
@@ -671,7 +665,7 @@ parse_assoc_decl (associativity assoc)
|
||||
case tok_number:
|
||||
if (prev == tok_identifier)
|
||||
{
|
||||
symval->user_token_number = numval;
|
||||
symbol_user_token_number_set (symval, numval);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user