mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-01 09:17:19 +02:00
Parser
- Modified ::findStrayModifications to use collect.
This commit is contained in:
parent
d7ba49084b
commit
1f0ce08042
1 changed files with 11 additions and 2 deletions
|
@ -190,8 +190,8 @@ Tree* Parser::parse ()
|
||||||
findIdSequence ();
|
findIdSequence ();
|
||||||
findFilter ();
|
findFilter ();
|
||||||
findModifications ();
|
findModifications ();
|
||||||
// GOOD ^^^
|
|
||||||
findStrayModifications ();
|
findStrayModifications ();
|
||||||
|
// GOOD ^^^
|
||||||
|
|
||||||
findPlainArgs ();
|
findPlainArgs ();
|
||||||
findMissingOperators ();
|
findMissingOperators ();
|
||||||
|
@ -1579,21 +1579,30 @@ void Parser::findModifications ()
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Parser::findStrayModifications ()
|
void Parser::findStrayModifications ()
|
||||||
{
|
{
|
||||||
|
context.debug ("Parser::findModifications");
|
||||||
|
bool action = false;
|
||||||
|
|
||||||
std::string command = getCommand ();
|
std::string command = getCommand ();
|
||||||
if (command == "add" ||
|
if (command == "add" ||
|
||||||
command == "log")
|
command == "log")
|
||||||
{
|
{
|
||||||
|
std::vector <Tree*> nodes;
|
||||||
|
collect (nodes, false);
|
||||||
std::vector <Tree*>::iterator i;
|
std::vector <Tree*>::iterator i;
|
||||||
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
|
for (i = nodes.begin (); i != nodes.end (); ++i)
|
||||||
{
|
{
|
||||||
if ((*i)->hasTag ("FILTER"))
|
if ((*i)->hasTag ("FILTER"))
|
||||||
{
|
{
|
||||||
(*i)->unTag ("FILTER");
|
(*i)->unTag ("FILTER");
|
||||||
(*i)->tag ("MODIFICATION");
|
(*i)->tag ("MODIFICATION");
|
||||||
(*i)->removeAllBranches ();
|
(*i)->removeAllBranches ();
|
||||||
|
action = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action)
|
||||||
|
context.debug (_tree->dump ());
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue