From 6e976e7d7c08ce7d6253f6eb6edcd0c0c244e679 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 21 Aug 2011 14:33:10 -0400 Subject: [PATCH] E9 - operator_equal - Added proper handling for missing dates to the '=' operator. This is a trial run of enhancements to lots of other operators to come. --- src/E9.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/E9.cpp b/src/E9.cpp index 1fe247731..e2adb0745 100644 --- a/src/E9.cpp +++ b/src/E9.cpp @@ -110,6 +110,7 @@ void E9::eval (const Task& task, std::vector & value_stack) operator_not (result, right); } /* + // TODO Unary -. else if (arg->raw == "-") { } @@ -153,9 +154,9 @@ void E9::eval (const Task& task, std::vector & value_stack) // Operand. else { + // Derive _value from _raw, and push on the stack. Arg operand (*arg); - // Expand the value if possible. if (operand._category == Arg::cat_dom && _dom) { operand._value = context.dom.get (operand._raw, task); @@ -445,8 +446,10 @@ void E9::operator_equal ( } // Dates. - else if (left._type == Arg::type_date || - right._type == Arg::type_date) + else if ((left._type == Arg::type_date || + right._type == Arg::type_date) && + left._value != "" && + right._value != "") { // std::cout << "# date matching\n"; Date left_date (left._value, _dateformat);