Parser
- Modified ::findTag to perform one action and repeat, rather than attempt everything at once, with an invalid iterator.
This commit is contained in:
@@ -920,13 +920,23 @@ void Parser::findSubstitution ()
|
||||
void Parser::findTag ()
|
||||
{
|
||||
context.debug ("Parser::findTag");
|
||||
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)
|
||||
{
|
||||
if (! (*i)->hasTag ("?"))
|
||||
continue;
|
||||
|
||||
if ((*i)->hasTag ("TERMINATOR") ||
|
||||
(*i)->hasTag ("TERMINATED"))
|
||||
break;
|
||||
|
||||
std::string raw = (*i)->attribute ("raw");
|
||||
Nibbler n (raw);
|
||||
|
||||
@@ -953,10 +963,12 @@ void Parser::findTag ()
|
||||
branch = (*i)->addBranch (new Tree ("argTag"));
|
||||
branch->attribute ("raw", tag);
|
||||
action = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (action);
|
||||
|
||||
if (action)
|
||||
context.debug (_tree->dump ());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user