mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-01 09:17:19 +02:00
Parser
- ::findIdSequence now safely removes nodes out of the iterator loop.
This commit is contained in:
parent
4f1b63ff02
commit
f898953a2e
1 changed files with 147 additions and 134 deletions
|
@ -1273,18 +1273,29 @@ void Parser::findAttributeModifier ()
|
|||
void Parser::findIdSequence ()
|
||||
{
|
||||
context.debug ("Parser::findIdSequence");
|
||||
bool action = false;
|
||||
bool action = true;
|
||||
|
||||
do
|
||||
{
|
||||
action = false;
|
||||
|
||||
std::vector <Tree*> nodes;
|
||||
collect (nodes);
|
||||
collect (nodes, collectAll);
|
||||
std::vector <Tree*>::iterator i;
|
||||
for (i = nodes.begin (); i != nodes.end (); ++i)
|
||||
{
|
||||
std::string raw = (*i)->attribute ("raw");
|
||||
|
||||
if (raw == "--")
|
||||
break;
|
||||
|
||||
if (! (*i)->hasTag ("?"))
|
||||
continue;
|
||||
|
||||
// Container for min/max ID ranges.
|
||||
std::vector <std::pair <int, int> > ranges;
|
||||
|
||||
// Split the ID list into elements.
|
||||
std::string raw = (*i)->attribute ("raw");
|
||||
std::vector <std::string> elements;
|
||||
split (elements, raw, ',');
|
||||
|
||||
|
@ -1422,9 +1433,11 @@ void Parser::findIdSequence ()
|
|||
branch->attribute ("raw", ")");
|
||||
branch->tag ("OP");
|
||||
action = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (action);
|
||||
|
||||
if (action)
|
||||
context.debug (_tree->dump ());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue