diff options
Diffstat (limited to 'src/NXP/Classes/TokenFactory.php')
-rw-r--r-- | src/NXP/Classes/TokenFactory.php | 10 |
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; } /** |