Fix LALR error reporting so <!-- x[0] = x[2] --> no more produces incorrect output (2)
parent
bf6d4a8bd3
commit
85635f9430
2
bug.tpl
2
bug.tpl
|
@ -1,2 +0,0 @@
|
||||||
This template produces incorrect output:
|
|
||||||
<!-- coord[0] = coord[2] -->
|
|
|
@ -1239,9 +1239,8 @@ class parse_engine {
|
||||||
case 'r':
|
case 'r':
|
||||||
if ($this->debug) echo "Reducing $type via rule $operand\n";
|
if ($this->debug) echo "Reducing $type via rule $operand\n";
|
||||||
$this->reduce($operand);
|
$this->reduce($operand);
|
||||||
$this->eat($type, $semantic);
|
|
||||||
// Yes, this is tail-recursive. It's also the simplest way.
|
// Yes, this is tail-recursive. It's also the simplest way.
|
||||||
break;
|
return $this->eat($type, $semantic);
|
||||||
case 'a':
|
case 'a':
|
||||||
if ($this->stack->occupied()) {
|
if ($this->stack->occupied()) {
|
||||||
throw new parse_bug('Accept should happen with empty stack.');
|
throw new parse_bug('Accept should happen with empty stack.');
|
||||||
|
|
Loading…
Reference in New Issue