-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Hi @fabpot
Twig-CS-Fixer use his own Lexer because
- he needs to keep space/tabs
- he uses more token types
The implementation worked fine so far, but just got recently broke by the 3.21 release since I inspired my getOperatorRegex
implementation by yours
Lines 547 to 551 in 3468920
$operators = array_merge( | |
['='], | |
array_keys($this->env->getUnaryOperators()), | |
array_keys($this->env->getBinaryOperators()) | |
); |
I implemented a fix to follow your new implementation
Lines 528 to 530 in b54a265
$expressionParsers = ['=']; | |
foreach ($this->env->getExpressionParsers() as $expressionParser) { | |
$expressionParsers = array_merge($expressionParsers, [$expressionParser->getName()], $expressionParser->getAliases()); |
(
, [
, =>
, ... for BC reason). But again getExpressionParsers
is internal.
Is there a way to write
$expressionParsers = ['='];
foreach ($this->env->getExpressionParsers() as $expressionParser) {
$expressionParsers = array_merge($expressionParsers, [$expressionParser->getName()], $expressionParser->getAliases());
}
without an internal method ? Would it be OK to make getExpressionParsers
part of the API ?
Thanks
BenjaminPorquet and Kevin-Adrea
Metadata
Metadata
Assignees
Labels
No labels