From a532338ca642ed386270047aefc56ed11ef120d3 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 24 Nov 2012 18:19:52 +0100 Subject: fixed command line termination * do it only in start state: so double escapes in strings do not cause a termination and an empty string may be specified * clear arithmetic stacks on line termination --- expressions.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'expressions.h') diff --git a/expressions.h b/expressions.h index 5d2aa0c..a441e90 100644 --- a/expressions.h +++ b/expressions.h @@ -100,6 +100,12 @@ public: { return top[-index]; } + + inline void + clear(void) + { + top = stack; + } }; /* @@ -172,6 +178,13 @@ public: int find_op(Operator op); + inline void + clear(void) + { + numbers.clear(); + operators.clear(); + } + private: void calc(void); -- cgit v1.2.3