Fix computation of expected tokens in parse errors

This commit is contained in:
Nikita Popov 2016-07-06 02:21:18 +02:00
parent 96cbd48df6
commit 81f7da3b23

View File

@ -351,7 +351,9 @@ abstract class ParserAbstract implements Parser
&& ($idx = $this->actionBase[$state + $this->YYNLSTATES] + $symbol) >= 0
&& $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol
) {
if ($this->action[$idx] != $this->unexpectedTokenRule) {
if ($this->action[$idx] != $this->unexpectedTokenRule
&& $this->action[$idx] != $this->defaultAction
) {
if (count($expected) == 4) {
/* Too many expected tokens */
return array();