mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 22:47:20 +02:00
CLI2: Added special case handling for '<name>:<value>', using operator '='
- By adding the special case, the desugarFilterAttributes and desugarFilterAttributeModifiers methods can be merged.
This commit is contained in:
parent
e504149a43
commit
8085b15b50
1 changed files with 7 additions and 11 deletions
18
src/CLI2.cpp
18
src/CLI2.cpp
|
@ -953,10 +953,6 @@ void CLI2::desugarFilterAttributes ()
|
||||||
if (! canonicalize (canonical, "attribute", name))
|
if (! canonicalize (canonical, "attribute", name))
|
||||||
canonicalize (canonical, "uda", name);
|
canonicalize (canonical, "uda", name);
|
||||||
|
|
||||||
// <name>:<value> is an assumed <name> is <value>
|
|
||||||
if (mod == "")
|
|
||||||
mod = "is";
|
|
||||||
|
|
||||||
// TODO The "!" modifier is being dropped.
|
// TODO The "!" modifier is being dropped.
|
||||||
|
|
||||||
A2 lhs (name, Lexer::Type::dom);
|
A2 lhs (name, Lexer::Type::dom);
|
||||||
|
@ -970,7 +966,13 @@ void CLI2::desugarFilterAttributes ()
|
||||||
A2 rhs ("", Lexer::Type::string);
|
A2 rhs ("", Lexer::Type::string);
|
||||||
rhs.tag ("FILTER");
|
rhs.tag ("FILTER");
|
||||||
|
|
||||||
if (mod == "before" || mod == "under" || mod == "below")
|
// Special case for '<name>:<value>'.
|
||||||
|
if (mod == "")
|
||||||
|
{
|
||||||
|
op.attribute ("raw", "=");
|
||||||
|
rhs.attribute ("raw", value);
|
||||||
|
}
|
||||||
|
else if (mod == "before" || mod == "under" || mod == "below")
|
||||||
{
|
{
|
||||||
op.attribute ("raw", "<");
|
op.attribute ("raw", "<");
|
||||||
rhs.attribute ("raw", value);
|
rhs.attribute ("raw", value);
|
||||||
|
@ -1051,12 +1053,6 @@ void CLI2::desugarFilterAttributes ()
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
std::string operatorLiteral = "=";
|
|
||||||
if (canonical == "status")
|
|
||||||
operatorLiteral = "==";
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
changes = true;
|
changes = true;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue