mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 07:57:20 +02:00
CLI2: ::desugarFilterAttributes now relies on earlier parsing
This commit is contained in:
parent
3f3d698a28
commit
29d6eceda1
1 changed files with 130 additions and 134 deletions
16
src/CLI2.cpp
16
src/CLI2.cpp
|
@ -1061,12 +1061,11 @@ void CLI2::desugarFilterAttributes ()
|
||||||
a.hasTag ("FILTER"))
|
a.hasTag ("FILTER"))
|
||||||
{
|
{
|
||||||
std::string raw = a.attribute ("raw");
|
std::string raw = a.attribute ("raw");
|
||||||
std::string name;
|
std::string name = a.attribute ("name");
|
||||||
std::string mod;
|
std::string mod = a.attribute ("modifier");
|
||||||
std::string sep;
|
std::string sep = a.attribute ("separator");
|
||||||
std::string value;
|
std::string value = a.attribute ("value");
|
||||||
if (Lexer::decomposePair (raw, name, mod, sep, value))
|
|
||||||
{
|
|
||||||
if (value == "")
|
if (value == "")
|
||||||
value = "''";
|
value = "''";
|
||||||
|
|
||||||
|
@ -1183,6 +1182,7 @@ void CLI2::desugarFilterAttributes ()
|
||||||
reconstructed.push_back (rhs);
|
reconstructed.push_back (rhs);
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the name does not canonicalize to either an attribute or a UDA
|
// If the name does not canonicalize to either an attribute or a UDA
|
||||||
// then it is not a recognized Lexer::Type::pair, so downgrade it to
|
// then it is not a recognized Lexer::Type::pair, so downgrade it to
|
||||||
// Lexer::Type::word.
|
// Lexer::Type::word.
|
||||||
|
@ -1196,10 +1196,6 @@ void CLI2::desugarFilterAttributes ()
|
||||||
else
|
else
|
||||||
reconstructed.push_back (a);
|
reconstructed.push_back (a);
|
||||||
}
|
}
|
||||||
// Failed to decompose.
|
|
||||||
else
|
|
||||||
reconstructed.push_back (a);
|
|
||||||
}
|
|
||||||
// Not a FILTER pair.
|
// Not a FILTER pair.
|
||||||
else
|
else
|
||||||
reconstructed.push_back (a);
|
reconstructed.push_back (a);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue