From 85635f9430839d2e57dbe5638fe05ff6af227e37 Mon Sep 17 00:00:00 2001 From: vitalif Date: Mon, 26 Aug 2013 12:10:13 +0000 Subject: [PATCH] Fix LALR error reporting so no more produces incorrect output (2) --- bug.tpl | 2 -- template.parser.php | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 bug.tpl diff --git a/bug.tpl b/bug.tpl deleted file mode 100644 index 7c88f46..0000000 --- a/bug.tpl +++ /dev/null @@ -1,2 +0,0 @@ -This template produces incorrect output: - diff --git a/template.parser.php b/template.parser.php index 8255c43..1c346c4 100644 --- a/template.parser.php +++ b/template.parser.php @@ -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.');