mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-04 03:18:33 +02:00
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.
This commit is contained in:
parent
2b961c128a
commit
6e976e7d7c
1 changed files with 6 additions and 3 deletions
|
@ -110,6 +110,7 @@ void E9::eval (const Task& task, std::vector <Arg>& value_stack)
|
|||
operator_not (result, right);
|
||||
}
|
||||
/*
|
||||
// TODO Unary -.
|
||||
else if (arg->raw == "-")
|
||||
{
|
||||
}
|
||||
|
@ -153,9 +154,9 @@ void E9::eval (const Task& task, std::vector <Arg>& 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue