Accept a token number in a %left, %right, or %nonassoc for POSIX

conformance.  Reported by Tim Josling at
<http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
* NEWS (2.3a+): Mention.
* doc/bison.texinfo (Precedence Decl): Describe how literal strings
and code numbers are treated by precedence declarations.
* src/parse-gram.y (precedence_declaration): Use symbols.prec instead
of symbols.1.
(symbols.prec): New, just like symbols.1 but uses symbol.prec instead
of symbol.
(symbol.prec): New, just like symbol but allows INT.
* src/symtab.c (symbol_user_token_number_set): Remove an aver that no
longer holds.
* tests/regression.at (Token number in precedence declaration): New
test case.
This commit is contained in:
Joel E. Denny
2008-02-17 00:18:36 +00:00
parent 80d2c3adcc
commit ab7f29f8f9
7 changed files with 365 additions and 225 deletions

View File

@@ -1,7 +1,7 @@
/* Symbol table manager for Bison.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free
Software Foundation, Inc.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -358,8 +358,6 @@ symbol_user_token_number_set (symbol *sym, int user_token_number, location loc)
{
int *user_token_numberp;
aver (sym->class == token_sym);
if (sym->user_token_number != USER_NUMBER_ALIAS)
user_token_numberp = &sym->user_token_number;
else