Skip to content

Commit

Permalink
Fix parsing of spaces in LL(k) token definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
blmage committed May 1, 2020
1 parent c620f44 commit 83f620b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Llk/Llk.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public static function parsePP($pp, &$tokens, &$rules, &$pragmas, $streamName)
$matches[3] .
')';
}
} elseif (0 !== preg_match('#^%token\h+(?:([^:]+):)?([^\h]+)\h+(.*?)(?:\h+->\h+(.*))?$#u', $line, $matches)) {
} elseif (0 !== preg_match('#^%token\h+(?:([^:\s]+):)?([^\s]+)\h+(.*?)(?:\h+->\h+(.*))?$#u', $line, $matches)) {
if (empty($matches[1])) {
$matches[1] = 'default';
}
Expand Down

0 comments on commit 83f620b

Please sign in to comment.