aboutsummaryrefslogtreecommitdiffstats
path: root/Llk/Parser.php
diff options
context:
space:
mode:
Diffstat (limited to 'Llk/Parser.php')
-rw-r--r--Llk/Parser.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/Llk/Parser.php b/Llk/Parser.php
index ee3588c..e8a4dfe 100644
--- a/Llk/Parser.php
+++ b/Llk/Parser.php
@@ -187,12 +187,17 @@ class Parser
if (false === $this->backtrack()) {
$token = $this->_errorToken;
+
+ if (null === $this->_errorToken) {
+ $token = $this->_tokenSequence->current();
+ }
+
$offset = $token['offset'];
$line = 1;
$column = 1;
if (!empty($text)) {
- if (0 === $offset || null === $offset) {
+ if (0 === $offset) {
$leftnl = 0;
} else {
$leftnl = strrpos($text, "\n", -(strlen($text) - $offset) - 1) ?: 0;