mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
A3t
- Reordered recognition of PSEUDO, UDA and ATTRIBUTE, which is a better precedence.
This commit is contained in:
parent
17c7c9646a
commit
db0f147b72
1 changed files with 21 additions and 16 deletions
37
src/A3t.cpp
37
src/A3t.cpp
|
@ -525,8 +525,13 @@ const std::string A3t::getFilterExpression () const
|
||||||
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||||
{
|
{
|
||||||
// TODO Insert implicit "and", "(" and ")" operators.
|
// TODO Insert implicit "and", "(" and ")" operators.
|
||||||
|
}
|
||||||
|
|
||||||
if ((*i)->hasTag ("FILTER"))
|
// TODO Construct an efficient ID/UUID clause.
|
||||||
|
|
||||||
|
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
||||||
|
{
|
||||||
|
if ((*i)->hasTag ("FILTER") && ! (*i)->hasTag ("PSEUDO"))
|
||||||
{
|
{
|
||||||
if ((*i)->hasTag ("ID"))
|
if ((*i)->hasTag ("ID"))
|
||||||
{
|
{
|
||||||
|
@ -740,7 +745,21 @@ void A3t::findAttribute ()
|
||||||
n.getUntilEOS (value))
|
n.getUntilEOS (value))
|
||||||
{
|
{
|
||||||
std::string canonical;
|
std::string canonical;
|
||||||
if (canonicalize (canonical, "attribute", name))
|
if (canonicalize (canonical, "uda", name))
|
||||||
|
{
|
||||||
|
(*i)->tag ("UDA");
|
||||||
|
(*i)->tag ("MODIFIABLE");
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (canonicalize (canonical, "pseudo", name))
|
||||||
|
{
|
||||||
|
(*i)->unTag ("?");
|
||||||
|
(*i)->tag ("PSEUDO");
|
||||||
|
(*i)->attribute ("name", canonical);
|
||||||
|
(*i)->attribute ("value", value);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (canonicalize (canonical, "attribute", name))
|
||||||
{
|
{
|
||||||
(*i)->unTag ("?");
|
(*i)->unTag ("?");
|
||||||
(*i)->tag ("ATTRIBUTE");
|
(*i)->tag ("ATTRIBUTE");
|
||||||
|
@ -755,20 +774,6 @@ void A3t::findAttribute ()
|
||||||
(*i)->tag ("MODIFIABLE");
|
(*i)->tag ("MODIFIABLE");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (canonicalize (canonical, "uda", name))
|
|
||||||
{
|
|
||||||
(*i)->tag ("UDA");
|
|
||||||
(*i)->tag ("MODIFIABLE");
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (canonicalize (canonical, "pseudo", name))
|
|
||||||
{
|
|
||||||
(*i)->unTag ("?");
|
|
||||||
(*i)->tag ("PSEUDO");
|
|
||||||
(*i)->attribute ("name", canonical);
|
|
||||||
(*i)->attribute ("value", value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue