mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CLI
- Updated ::desugarAttributes to properly handle UDA and PSEUDO args. - Cleaned up handling or ATTRIBUTE.
This commit is contained in:
parent
7ff55037a6
commit
22d3852bfd
1 changed files with 26 additions and 18 deletions
44
src/CLI.cpp
44
src/CLI.cpp
|
@ -681,21 +681,32 @@ void CLI::desugarAttributes ()
|
|||
std::string canonical;
|
||||
if (canonicalize (canonical, "uda", name))
|
||||
{
|
||||
A left ("argUDA", name);
|
||||
left.attribute ("name", canonical);
|
||||
left.tag ("UDA");
|
||||
left.tag ("MODIFIABLE");
|
||||
left.tag ("FILTER");
|
||||
reconstructed.push_back (left);
|
||||
A lhs ("argUDA", name);
|
||||
lhs.attribute ("name", canonical);
|
||||
lhs.tag ("UDA");
|
||||
lhs.tag ("ATTRIBUTE");
|
||||
lhs.tag ("FILTER");
|
||||
|
||||
A op ("argUDA", "=");
|
||||
op.tag ("OP");
|
||||
op.tag ("FILTER");
|
||||
|
||||
A rhs ("argUDA", value);
|
||||
rhs.tag ("LITERAL");
|
||||
rhs.tag ("FILTER");
|
||||
|
||||
reconstructed.push_back (lhs);
|
||||
reconstructed.push_back (op);
|
||||
reconstructed.push_back (rhs);
|
||||
found = true;
|
||||
}
|
||||
|
||||
else if (canonicalize (canonical, "pseudo", name))
|
||||
{
|
||||
A left ("argUDA", name);
|
||||
left.attribute ("name", canonical);
|
||||
left.tag ("PSEUDO");
|
||||
reconstructed.push_back (left);
|
||||
A lhs ("argPseudo", name);
|
||||
lhs.attribute ("name", canonical);
|
||||
lhs.tag ("PSEUDO");
|
||||
reconstructed.push_back (lhs);
|
||||
found = true;
|
||||
}
|
||||
|
||||
|
@ -706,19 +717,16 @@ void CLI::desugarAttributes ()
|
|||
lhs.tag ("ATTRIBUTE");
|
||||
lhs.tag ("FILTER");
|
||||
|
||||
std::map <std::string, Column*>::const_iterator col;
|
||||
col = context.columns.find (canonical);
|
||||
if (col != context.columns.end () &&
|
||||
col->second->modifiable ())
|
||||
{
|
||||
lhs.tag ("MODIFIABLE");
|
||||
}
|
||||
std::string operatorLiteral = "=";
|
||||
if (canonical == "status")
|
||||
operatorLiteral = "==";
|
||||
|
||||
A op ("argAtt", "=");
|
||||
A op ("argAtt", operatorLiteral);
|
||||
op.tag ("OP");
|
||||
op.tag ("FILTER");
|
||||
|
||||
A rhs ("argAtt", value);
|
||||
rhs.tag ("LITERAL");
|
||||
rhs.tag ("FILTER");
|
||||
|
||||
reconstructed.push_back (lhs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue