aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/Tokenizer.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/NXP/Classes/Tokenizer.php')
-rw-r--r--src/NXP/Classes/Tokenizer.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/NXP/Classes/Tokenizer.php b/src/NXP/Classes/Tokenizer.php
index bb6fa15..f8056c3 100644
--- a/src/NXP/Classes/Tokenizer.php
+++ b/src/NXP/Classes/Tokenizer.php
@@ -150,11 +150,11 @@ class Tokenizer
$this->tokens[] = new Token(Token::ParamSeparator, '');
break;
default:
- // special case for unary minus
- if ($ch == '-') {
+ // special case for unary operations
+ if ($ch == '-' || $ch == '+') {
if ($this->allowNegative) {
$this->allowNegative = false;
- $this->tokens[] = new Token(Token::Operator, '`');
+ $this->tokens[] = new Token(Token::Operator, $ch == '-' ? 'uNeg' : 'uPos');
continue 2;
}
// could be in exponent, in which case negative should be added to the numberBuffer