aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/MathExecutor.php
diff options
context:
space:
mode:
authorBruce Wells <brucekwells@gmail.com>2021-02-17 06:13:44 +0300
committerGitHub <noreply@github.com>2021-02-17 06:13:44 +0300
commit17cc5b9dc48b19e0dee1937080601a9fc2890af4 (patch)
treebbb9da21341cff2079cc83c749a45934c81b3bd3 /src/NXP/MathExecutor.php
parent936ee5caca3067de98a40d5a5788946b6f2b87dc (diff)
Unary Minus (#84)V2.1.7
Fixed unary minus to allow a minus sign in front of functions and parentheses.
Diffstat (limited to 'src/NXP/MathExecutor.php')
-rw-r--r--src/NXP/MathExecutor.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/NXP/MathExecutor.php b/src/NXP/MathExecutor.php
index ca27539..b8e8a65 100644
--- a/src/NXP/MathExecutor.php
+++ b/src/NXP/MathExecutor.php
@@ -99,6 +99,13 @@ class MathExecutor
170,
false
],
+ '`' => [ // unary minus token
+ function ($a) {
+ return 0 - $a;
+ },
+ 200,
+ false
+ ],
'*' => [
function ($a, $b) {
return $a * $b;