mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Parser
- ::findAttributeModifier now tolerates missing values and generates the correct expression term.
This commit is contained in:
parent
fc5dad7a9a
commit
5df49ec5e3
1 changed files with 9 additions and 5 deletions
|
@ -814,6 +814,9 @@ void Parser::findAttribute ()
|
||||||
n.getUntilEOS (value) ||
|
n.getUntilEOS (value) ||
|
||||||
n.depleted ())
|
n.depleted ())
|
||||||
{
|
{
|
||||||
|
if (value == "")
|
||||||
|
value = "''";
|
||||||
|
|
||||||
std::string canonical;
|
std::string canonical;
|
||||||
if (canonicalize (canonical, "uda", name))
|
if (canonicalize (canonical, "uda", name))
|
||||||
{
|
{
|
||||||
|
@ -858,10 +861,7 @@ void Parser::findAttribute ()
|
||||||
branch->attribute ("raw", "==");
|
branch->attribute ("raw", "==");
|
||||||
|
|
||||||
branch = (*i)->addBranch (new Tree ("argAtt"));
|
branch = (*i)->addBranch (new Tree ("argAtt"));
|
||||||
if (value != "")
|
branch->attribute ("raw", value);
|
||||||
branch->attribute ("raw", value);
|
|
||||||
else
|
|
||||||
branch->attribute ("raw", "'" + value + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -909,8 +909,12 @@ void Parser::findAttributeModifier ()
|
||||||
std::string value;
|
std::string value;
|
||||||
if (n.getQuoted ('"', value) ||
|
if (n.getQuoted ('"', value) ||
|
||||||
n.getQuoted ('\'', value) ||
|
n.getQuoted ('\'', value) ||
|
||||||
n.getUntilEOS (value))
|
n.getUntilEOS (value) ||
|
||||||
|
n.depleted ())
|
||||||
{
|
{
|
||||||
|
if (value == "")
|
||||||
|
value = "''";
|
||||||
|
|
||||||
(*i)->unTag ("?");
|
(*i)->unTag ("?");
|
||||||
(*i)->tag ("ATTMOD");
|
(*i)->tag ("ATTMOD");
|
||||||
(*i)->attribute ("name", canonical);
|
(*i)->attribute ("name", canonical);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue