aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/TokenFactory.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/NXP/Classes/TokenFactory.php')
-rw-r--r--src/NXP/Classes/TokenFactory.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/NXP/Classes/TokenFactory.php b/src/NXP/Classes/TokenFactory.php
index 74b5789..5aa634a 100644
--- a/src/NXP/Classes/TokenFactory.php
+++ b/src/NXP/Classes/TokenFactory.php
@@ -133,21 +133,21 @@ class TokenFactory
{
$operatorsRegex = '';
foreach ($this->operators as $operator) {
- $operatorsRegex .= $operator::getRegex();
+ $operatorsRegex .= '|(' . $operator::getRegex() . ')';
}
-
- return sprintf(
- '/(%s)|(%s)|(%s)|([%s])|(%s)|(%s)|([%s%s%s])/i',
+ $s = sprintf(
+ '/(%s)|(%s)|(%s)|(%s)|(%s)|([%s%s%s])',
TokenNumber::getRegex(),
TokenStringDoubleQuoted::getRegex(),
TokenStringSingleQuoted::getRegex(),
- $operatorsRegex,
TokenFunction::getRegex(),
TokenVariable::getRegex(),
TokenLeftBracket::getRegex(),
TokenRightBracket::getRegex(),
TokenComma::getRegex()
);
+ $s .= $operatorsRegex . '/i';
+ return $s;
}
/**