aboutsummaryrefslogtreecommitdiffhomepage
path: root/expressions.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-07 19:08:15 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-07 19:08:15 +0100
commit99c8e92238986d00557ded56adc8495086d3c631 (patch)
treed85adc60f1880fc9ef9f231407a78414039698a5 /expressions.h
parent408f8311dd071924d62ae10d0078e595e9137a9e (diff)
downloadsciteco-99c8e92238986d00557ded56adc8495086d3c631.tar.gz
fixed "," operator
instead of pushing a special number (which wasn't that special...), use a dedicated "new" operator which does not count as an argument operator, nor does it count as an ordinary operator and it is popped before any number (and "number" operator) is pushed
Diffstat (limited to 'expressions.h')
-rw-r--r--expressions.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/expressions.h b/expressions.h
index 4a33632..0f4c9eb 100644
--- a/expressions.h
+++ b/expressions.h
@@ -110,6 +110,7 @@ public:
OP_AND, // &
OP_OR, // #
// pseudo operators:
+ OP_NEW,
OP_BRACE,
OP_LOOP,
OP_NUMBER
@@ -130,11 +131,6 @@ public:
gint64 push(gint64 number);
- inline gint64
- peek_num(int index = 1)
- {
- return numbers.peek(index);
- }
gint64 pop_num(int index = 1);
gint64 pop_num_calc(int index, gint64 imply);
inline gint64
@@ -155,12 +151,7 @@ public:
void eval(bool pop_brace = false);
int args(void);
- inline int
- first_op(void)
- {
- int n = args() + 1;
- return n > operators.items() ? 0 : n;
- }
+ int first_op(void);
void discard_args(void);
} expressions;