From 9111866f808563eaac66cee20a453103c04f110f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 17 Aug 2014 13:15:57 -0400 Subject: [PATCH] Parser - Modified ::findUUIDList to use collect. --- src/Parser.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Parser.cpp b/src/Parser.cpp index 9196c6f81..5712af660 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -185,8 +185,8 @@ Tree* Parser::parse () findAttribute (); findAttributeModifier (); findOperator (); - // GOOD ^^^ findCommand (); + // GOOD ^^^ findUUIDList (); findIdSequence (); findFilter (); @@ -425,7 +425,7 @@ void Parser::resolveAliases () // autoCompletes to a valid command/report. void Parser::findCommand () { - context.debug ("Parse::findOverrides"); + context.debug ("Parse::findCommand"); std::vector nodes; collect (nodes, false); @@ -1384,17 +1384,14 @@ void Parser::findIdSequence () //////////////////////////////////////////////////////////////////////////////// void Parser::findUUIDList () { + context.debug ("Parser::findUUIDList"); + bool action = 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) { - // Parser override operator. - if ((*i)->attribute ("raw") == "--") - break; - - // Skip known args. - if (! (*i)->hasTag ("?")) - continue; - std::string raw = (*i)->attribute ("raw"); Nibbler n (raw); @@ -1448,9 +1445,13 @@ void Parser::findUUIDList () branch = (*i)->addBranch (new Tree ("argSeq")); branch->attribute ("raw", ")"); branch->tag ("OP"); + action = true; } } } + + if (action) + context.debug (_tree->dump ()); } ////////////////////////////////////////////////////////////////////////////////