]> git.saurik.com Git - bison.git/commitdiff
gram: correct token numbering in precedence declarations
authorValentin Tolmer <nitnelave1@gmail.com>
Tue, 5 Mar 2013 11:29:50 +0000 (12:29 +0100)
committerAkim Demaille <akim@lrde.epita.fr>
Wed, 6 Mar 2013 09:31:47 +0000 (10:31 +0100)
In a precedence declaration, when tokens are declared with a litteral
character (e.g., 'a') or with a identifier (e.g., B), Bison behaved
differently: the litteral tokens would be numbered first, and then the
other ones, leading to the following grammar:

  %right A B 'c' 'd'

being numbered as such: 'c' 'd' A B.

* src/parse-gram.y (symbol.prec): Set the symbol number when reading the
symbols.
* tests/conflicts.at (Token declaration order: literals vs. identifiers):
New.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>

No differences found