Actually return false from eat() on error for reduce part

Vitaliy Filippov 2013-08-26 16:12:51 +04:00
parent a5afc90b9b
commit 52918751c4
1 changed files with 1 additions and 2 deletions

View File

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