- ::findIdSequence now safely removes nodes out of the iterator loop.
This commit is contained in:
Paul Beckingham 2014-08-24 13:14:52 -04:00
parent 4f1b63ff02
commit f898953a2e

View file

@ -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 ());
}