Fix LALR error reporting so <!-- x[0] = x[2] --> no more produces incorrect output (2)

databind
vitalif 2013-08-26 12:10:13 +00:00 committed by Vitaliy Filippov
parent bf6d4a8bd3
commit 85635f9430
2 changed files with 1 additions and 4 deletions

View File

@ -1,2 +0,0 @@
This template produces incorrect output:
<!-- coord[0] = coord[2] -->

View File

@ -1239,9 +1239,8 @@ class parse_engine {
case 'r':
if ($this->debug) echo "Reducing $type via rule $operand\n";
$this->reduce($operand);
$this->eat($type, $semantic);
// Yes, this is tail-recursive. It's also the simplest way.
break;
return $this->eat($type, $semantic);
case 'a':
if ($this->stack->occupied()) {
throw new parse_bug('Accept should happen with empty stack.');