Skip to content

Commit

Permalink
Feat: Issue #743: Add support for litteral with specific characters (…
Browse files Browse the repository at this point in the history
…name use instead of property access)
  • Loading branch information
marcghaly committed May 15, 2023
1 parent 932f84a commit c517525
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vendor/symfony/expression-language/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public function tokenize($expression)
}
$tokens[] = new Token(Token::NUMBER_TYPE, $number, $cursor + 1);
$cursor += \strlen($match[0]);
} elseif (preg_match("/{'(\W[a-zA-Z_\x7f-\xff][a-zA-Z0-9_.\x7f-\xff]*)'}/A", $expression, $match, 0, $cursor)) {
// names litteral
$tokens[] = new Token(Token::NAME_TYPE, $match[1], $cursor + 1);
$cursor += \strlen($match[0]);
} elseif (false !== strpos('([{', $expression[$cursor])) {
// opening bracket
$brackets[] = [$expression[$cursor], $cursor];
Expand Down

0 comments on commit c517525

Please sign in to comment.