Skip to content

Commit

Permalink
Merge pull request #26 from xepozz/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
SerafimArts committed Apr 29, 2024
1 parent 5ed09de commit 45f94d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,12 @@ public function lex($source, int $offset = 0): iterable
}

$unknown = [];
$skip = array_flip($this->skip);

try {
foreach ($this->driver->run($this->tokens, $source, $offset) as $token) {
// Process "hidden" tokens.
if (\in_array($token->getName(), $this->skip, true)) {
if (isset($skip[$token->getName()])) {
if (($handledToken = $this->handleHiddenToken($source, $token)) !== null) {
yield $handledToken;
}
Expand Down

0 comments on commit 45f94d6

Please sign in to comment.