From c0424cedeb125202f2ee6d05179442aa9fb44d23 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 28 Dec 2014 09:18:59 -0500 Subject: [PATCH] Eval - The _neg_ operator was a copy/paste of the ! operator, and needed to be numeric, not boolean. --- src/Eval.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Eval.cpp b/src/Eval.cpp index 912086105..c1d644576 100644 --- a/src/Eval.cpp +++ b/src/Eval.cpp @@ -273,13 +273,17 @@ void Eval::evaluatePostfixStack ( Variant right = values.back (); values.pop_back (); + + Variant result (0); + result -= right; + if (_debug) { context.debug (format ("[{1}] eval pop '{2}'", values.size () + 1, (std::string) right)); context.debug (format ("[{1}] eval operator '{2}'", values.size (), token->first)); - context.debug (format ("[{1}] eval result push '{2}'", values.size (), (bool) !right)); + context.debug (format ("[{1}] eval result push '{2}'", values.size (), (std::string) result)); } - values.push_back (Variant (0) - right); + values.push_back (result); } else if (token->second == Lexer::typeOperator && token->first == "_pos_")