]> git.saurik.com Git - bison.git/commit - tests/conflicts.at
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)
commit5202b6ac1d3662fe283240aab1b29f35607995cd
tree05815f7c4c8624f4268421bcebaba5917d7a8857
parent02879b4e811b0404736a706cba8cf09ecffa03c3
gram: correct token numbering in precedence declarations

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>
NEWS
src/parse-gram.y
tests/conflicts.at