diff --git a/parse_engine.php b/parse_engine.php index 6d4f217..bb9d02b 100644 --- a/parse_engine.php +++ b/parse_engine.php @@ -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.');