We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eae50a3 commit be4b3a4Copy full SHA for be4b3a4
src/GrammarProcessing/LexicalGrammar.php
@@ -42,10 +42,6 @@ public function parseSource(string $source): TokenStream
42
throw new UnexpectedTokenException("Can't parse source: " . preg_last_error_msg(), null);
43
}
44
45
- if ($matches === []) {
46
- return new TokenStream([]);
47
- }
48
-
49
$getLocation = function (int $offset) use ($source): Location {
50
$precedingText = substr($source, 0, $offset);
51
@@ -76,6 +72,10 @@ public function parseSource(string $source): TokenStream
76
72
);
77
73
78
74
75
+ if ($matches === []) {
+ return new TokenStream([]);
+ }
+
79
if ($this->ignoredTokenSymbols !== []) {
80
if (count($this->ignoredTokenSymbols) === 1) {
81
$matches = array_values(
0 commit comments