mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Expressions
- Project and Recur attributes now match leftmost by default.
This commit is contained in:
parent
43e72b8ac8
commit
8c6e5277ec
1 changed files with 16 additions and 1 deletions
|
@ -77,6 +77,9 @@ bool Expression::eval (Task& task)
|
|||
// against each task.
|
||||
std::vector <Variant> value_stack;
|
||||
|
||||
// Case sensitivity is configurable.
|
||||
bool case_sensitive = context.config.getBoolean ("search.case.sensitive");
|
||||
|
||||
// TODO Build an on-demand regex cache.
|
||||
|
||||
std::vector <std::pair <std::string, std::string> >::const_iterator arg;
|
||||
|
@ -234,7 +237,19 @@ bool Expression::eval (Task& task)
|
|||
else if (arg->first == "=")
|
||||
{
|
||||
// std::cout << "# " << left.dump () << " = " << right.dump () << "\n";
|
||||
bool result = (left == right);
|
||||
bool result = false;
|
||||
if (left._raw == "project" || left._raw == "recur")
|
||||
{
|
||||
left.cast (Variant::v_string);
|
||||
right.cast (Variant::v_string);
|
||||
if (right._string.length () <= left._string.length ())
|
||||
result = compare (right._string,
|
||||
left._string.substr (0, right._string.length ()),
|
||||
(bool) case_sensitive);
|
||||
}
|
||||
else
|
||||
result = (left == right);
|
||||
|
||||
left = Variant (result);
|
||||
left._raw_type = "bool";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue