- ::findAttribute was not considering all nodes, and failed to remove the "?" tag.
This commit is contained in:
Paul Beckingham 2014-08-24 16:37:17 -04:00
parent 8b904a57f4
commit 59ffcd858e

View file

@ -951,19 +951,23 @@ void Parser::findTag ()
// <name>:['"][<value>]['"] // <name>:['"][<value>]['"]
void Parser::findAttribute () void Parser::findAttribute ()
{ {
// context.debug ("Parser::findAttribute");
bool action = true; bool action = true;
do do
{ {
action = false; action = false;
std::vector <Tree*> nodes; std::vector <Tree*> nodes;
collect (nodes); collect (nodes, collectAll);
std::vector <Tree*>::iterator i; std::vector <Tree*>::iterator i;
for (i = nodes.begin (); i != nodes.end (); ++i) for (i = nodes.begin (); i != nodes.end (); ++i)
{ {
std::string raw = (*i)->attribute ("raw"); std::string raw = (*i)->attribute ("raw");
if ((*i)->hasTag ("--"))
break;
if (! (*i)->hasTag ("?"))
continue;
Nibbler n (raw); Nibbler n (raw);
// Look for a valid attribute name. // Look for a valid attribute name.
@ -985,6 +989,7 @@ void Parser::findAttribute ()
std::string canonical; std::string canonical;
if (canonicalize (canonical, "uda", name)) if (canonicalize (canonical, "uda", name))
{ {
(*i)->unTag ("?");
(*i)->tag ("UDA"); (*i)->tag ("UDA");
(*i)->tag ("MODIFIABLE"); (*i)->tag ("MODIFIABLE");
action = true; action = true;
@ -1041,8 +1046,6 @@ void Parser::findAttribute ()
} }
} }
while (action); while (action);
// context.debug (_tree->dump ());
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////