From 1f0ce0804222e6c5fe01b664574aed21004ab0d8 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 17 Aug 2014 13:24:31 -0400 Subject: [PATCH] Parser - Modified ::findStrayModifications to use collect. --- src/Parser.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Parser.cpp b/src/Parser.cpp index de259a8a8..89aadd89d 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -190,8 +190,8 @@ Tree* Parser::parse () findIdSequence (); findFilter (); findModifications (); - // GOOD ^^^ findStrayModifications (); + // GOOD ^^^ findPlainArgs (); findMissingOperators (); @@ -1579,21 +1579,30 @@ void Parser::findModifications () //////////////////////////////////////////////////////////////////////////////// void Parser::findStrayModifications () { + context.debug ("Parser::findModifications"); + bool action = false; + std::string command = getCommand (); if (command == "add" || command == "log") { + 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 ("FILTER")) { (*i)->unTag ("FILTER"); (*i)->tag ("MODIFICATION"); (*i)->removeAllBranches (); + action = true; } } } + + if (action) + context.debug (_tree->dump ()); } ////////////////////////////////////////////////////////////////////////////////