aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-12 06:26:09 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-12 06:26:09 +0100
commit50de1043dc325c8e1adda94c6113607e741d4015 (patch)
tree46ffeb55fa3b5931bc1125858de6bf394487e5d4 /parser.cpp
parent59eb0628db77e1145db797406e4de9f97b70d8e2 (diff)
downloadsciteco-50de1043dc325c8e1adda94c6113607e741d4015.tar.gz
various arithmetic expression fixes: SUB must have higher precedence than ADD; fixed num_sign (unary minus) handling
Diffstat (limited to 'parser.cpp')
-rw-r--r--parser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/parser.cpp b/parser.cpp
index 6365277..f73bedd 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -412,6 +412,8 @@ StateStart::custom(gchar chr)
case '(':
BEGIN_EXEC(this);
if (expressions.num_sign < 0) {
+ expressions.set_num_sign(1);
+ expressions.eval();
expressions.push(-1);
expressions.push_calc(Expressions::OP_MUL);
}