- Fixed bugs #865 and #886, which caused silent failure of unrecognized dates
  (thanks to Michelle Crane).
This commit is contained in:
Paul Beckingham 2012-02-27 00:36:53 -05:00
parent 5feb736939
commit e42a5a831a
3 changed files with 69 additions and 8 deletions

View file

@ -168,25 +168,26 @@ void E9::eval (const Task& task, std::vector <Arg>& value_stack)
if (operand._category == Arg::cat_dom && _dom)
{
operand._category = Arg::cat_literal;
operand._value = context.dom.get (operand._raw, task);
operand._category = Arg::cat_literal;
}
else if (operand._type == Arg::type_date &&
operand._category == Arg::cat_literal)
else if (operand._type == Arg::type_date)
{
operand._value = Date (operand._raw, _dateformat).toEpochString ();
operand._category = Arg::cat_literal;
operand._value = (operand._raw != "")
? Date (operand._raw, _dateformat).toEpochString ()
: "";
}
else if (operand._type == Arg::type_duration &&
operand._category == Arg::cat_literal)
else if (operand._type == Arg::type_duration)
{
operand._value = (std::string)Duration (operand._raw);
operand._category = Arg::cat_literal;
operand._value = (operand._raw != "")
? (std::string)Duration (operand._raw)
: "";
}
else
operand._value = operand._raw;
// std::cout << "# E9::eval operand " << operand << "\n";
value_stack.push_back (operand);
}
}