aboutsummaryrefslogtreecommitdiffstats
path: root/Llk
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2016-02-22 11:28:54 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2016-07-15 16:50:21 +0200
commit0daced3839b82ab3e10ae896460b52a1a3d42fb8 (patch)
treec654f3d15ba9dee1dfad347698ddcf76d2edafe9 /Llk
parentc7dfc2b587d2de3ecf63af2f6e22b5bd33ef70d6 (diff)
downloadCompiler-0daced3839b82ab3e10ae896460b52a1a3d42fb8.zip
Compiler-0daced3839b82ab3e10ae896460b52a1a3d42fb8.tar.gz
Compiler-0daced3839b82ab3e10ae896460b52a1a3d42fb8.tar.bz2
Parser: Cut backtrack if k is reached.
Diffstat (limited to 'Llk')
-rw-r--r--Llk/Parser.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/Llk/Parser.php b/Llk/Parser.php
index a5e0987..c07671d 100644
--- a/Llk/Parser.php
+++ b/Llk/Parser.php
@@ -463,6 +463,10 @@ class Parser
$found = $zeRule instanceof Rule\Repetition;
} elseif ($last instanceof Rule\Token) {
$this->_tokenSequence->previous();
+
+ if (false === $this->_tokenSequence->valid()) {
+ return false;
+ }
}
} while (0 < count($this->_trace) && false === $found);