From b7d668fb7d47d5e369b94d2a7ec3116b2757673f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 15 Jun 2014 09:32:17 -0400 Subject: [PATCH] Eval - Raises an exception if an expression evaluation yields an unexpected stack size at the end. This indicates that an expression like 'one two' was evaluated. Note that string field updates require evaluation, but this case occurs frequently. --- src/Eval.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Eval.cpp b/src/Eval.cpp index 1d364648d..f219637b4 100644 --- a/src/Eval.cpp +++ b/src/Eval.cpp @@ -363,10 +363,10 @@ void Eval::evaluatePostfixStack ( } } - // Should only be one value left on the stack. + // If there is more than one variant left on the stack, then the original + // expression was not valid. if (values.size () != 1) - if (_debug) - std::cout << "# Error: Unexpected stack size: " << values.size () << "\n"; + throw std::string ("The expression could not be evaluated."); result = values[0]; }