Skip to content

Commit

Permalink
TagLexer: typo in regexp [Closes nette/application#321]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 5, 2024
1 parent c4b177a commit e37a7e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Latte/Compiler/TagLexer.php
Expand Up @@ -82,8 +82,8 @@ public function tokenizeUnquotedString(string $input, Position $position, bool $
{
preg_match(
$colon
? '~ ( [./@_a-z0-9#!-] | :(?!:) | \{\$ [_a-z0-9\[\]()>-]+ })++ (?=\s+[!"\'$(\[{,\\|\~\w-] | [,|] | \s*$) ~xAi'
: '~ ( [./@_a-z0-9#!-] | \{\$ [_a-z0-9\[\]()>-]+ })++ (?=\s+[!"\'$(\[{,\\|\~\w-] | [,:|] | \s*$) ~xAi',
? '~ ( [./@_a-z0-9#!-] | :(?!:) | \{\$ [_a-z0-9\[\]()>-]+ })++ (?=\s+[!"\'$(\[{,\\\\|\~\w-] | [,|] | \s*$) ~xAi'
: '~ ( [./@_a-z0-9#!-] | \{\$ [_a-z0-9\[\]()>-]+ })++ (?=\s+[!"\'$(\[{,\\\\|\~\w-] | [,:|] | \s*$) ~xAi',
$input,
$match,
offset: $position->offset - $offsetDelta,
Expand Down
Expand Up @@ -64,6 +64,7 @@ Assert::same("'fo:o'", format('fo:o ,'));
Assert::same("'fo:o'", format('fo:o foo'));
Assert::same("'fo:o'", format('fo:o ()'));
Assert::same("'fo:o'", format('fo:o ""'));
Assert::same("'fo:o'", format('fo:o \foo'));

// non-unquoted & following chars
Assert::same('true ? false : null', format('true ? false'));
Expand Down

0 comments on commit e37a7e1

Please sign in to comment.