mirror of https://github.com/vitalif/lime
Actually return false from eat() on error for reduce part
parent
a5afc90b9b
commit
52918751c4
|
@ -313,9 +313,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.');
|
||||
|
|
Loading…
Reference in New Issue