From d7ba49084bcc63fb3be3bba353f681229317aa7a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 17 Aug 2014 13:22:25 -0400 Subject: [PATCH] Parser - Modified ::findModifications to use collect. --- src/Parser.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Parser.cpp b/src/Parser.cpp index 036c17426..de259a8a8 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -189,8 +189,8 @@ Tree* Parser::parse () findUUIDList (); findIdSequence (); findFilter (); - // GOOD ^^^ findModifications (); + // GOOD ^^^ findStrayModifications (); findPlainArgs (); @@ -1545,9 +1545,15 @@ void Parser::findFilter () //////////////////////////////////////////////////////////////////////////////// void Parser::findModifications () { + context.debug ("Parser::findModifications"); + bool action = false; + bool after_writecmd = false; + + std::vector nodes; + collect (nodes, false); std::vector ::iterator i; - for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i) + for (i = nodes.begin (); i != nodes.end (); ++i) { if ((*i)->hasTag ("WRITECMD")) after_writecmd = true; @@ -1562,8 +1568,12 @@ void Parser::findModifications () (*i)->unTag ("?"); (*i)->tag ("MODIFICATION"); (*i)->removeAllBranches (); + action = true; } } + + if (action) + context.debug (_tree->dump ()); } ////////////////////////////////////////////////////////////////////////////////