mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Parser
- ::findOperator moves brnach pruning outside the iterated loop.
This commit is contained in:
parent
e26f0f0dc9
commit
d6ad010085
1 changed files with 7 additions and 4 deletions
|
@ -1493,7 +1493,6 @@ void Parser::findUUIDList ()
|
||||||
void Parser::findOperator ()
|
void Parser::findOperator ()
|
||||||
{
|
{
|
||||||
context.debug ("Parser::findOperator");
|
context.debug ("Parser::findOperator");
|
||||||
bool action = false;
|
|
||||||
|
|
||||||
// Find the category.
|
// Find the category.
|
||||||
std::pair <std::multimap <std::string, std::string>::const_iterator, std::multimap <std::string, std::string>::const_iterator> c;
|
std::pair <std::multimap <std::string, std::string>::const_iterator, std::multimap <std::string, std::string>::const_iterator> c;
|
||||||
|
@ -1505,6 +1504,7 @@ void Parser::findOperator ()
|
||||||
for (e = c.first; e != c.second; ++e)
|
for (e = c.first; e != c.second; ++e)
|
||||||
options.push_back (e->second);
|
options.push_back (e->second);
|
||||||
|
|
||||||
|
std::vector <Tree*> prune;
|
||||||
std::vector <Tree*> nodes;
|
std::vector <Tree*> nodes;
|
||||||
collect (nodes);
|
collect (nodes);
|
||||||
std::vector <Tree*>::iterator i;
|
std::vector <Tree*>::iterator i;
|
||||||
|
@ -1513,13 +1513,16 @@ void Parser::findOperator ()
|
||||||
if (std::find (options.begin (), options.end (), (*i)->attribute ("raw")) != options.end ())
|
if (std::find (options.begin (), options.end (), (*i)->attribute ("raw")) != options.end ())
|
||||||
{
|
{
|
||||||
(*i)->unTag ("?");
|
(*i)->unTag ("?");
|
||||||
(*i)->removeAllBranches ();
|
|
||||||
(*i)->tag ("OP");
|
(*i)->tag ("OP");
|
||||||
action = true;
|
prune.push_back (*i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action)
|
// Prune branches outside the loop.
|
||||||
|
for (i = prune.begin (); i != prune.end (); ++i)
|
||||||
|
(*i)->removeAllBranches ();
|
||||||
|
|
||||||
|
if (prune.size ())
|
||||||
context.debug (_tree->dump ());
|
context.debug (_tree->dump ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue