diff --git a/src/CLI.cpp b/src/CLI.cpp index 49b17ea3d..28014544e 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -271,7 +271,7 @@ void CLI::add (const std::string& arg) // Intended to be called after ::initialize() and ::add(), to perform the final // analysis. Analysis is also performed directly after the above, because there // is a need to extract overrides early, before entities are proviedd. -void CLI::analyze () +void CLI::analyze (bool parse /* = true */) { // Clean what needs to be cleaned. Most in this case. _args.clear (); @@ -311,22 +311,25 @@ void CLI::analyze () findOverrides (); categorize (); - // Remove all the syntactic sugar for FILTERs. - desugarTags (); - desugarAttributes (); - desugarAttributeModifiers (); - desugarPatterns (); - desugarIDs (); - desugarUUIDs (); - //desugarPlainArgs (); - findOperators (); - insertJunctions (); + if (parse) + { + // Remove all the syntactic sugar for FILTERs. + desugarTags (); + desugarAttributes (); + desugarAttributeModifiers (); + desugarPatterns (); + desugarIDs (); + desugarUUIDs (); + findOperators (); + insertJunctions (); + desugarPlainArgs (); - // Decompose the elements for MODIFICATIONs. - decomposeModAttributes (); - decomposeModAttributeModifiers (); - decomposeModTags (); - decomposeModSubstitutions (); + // Decompose the elements for MODIFICATIONs. + decomposeModAttributes (); + decomposeModAttributeModifiers (); + decomposeModTags (); + decomposeModSubstitutions (); + } } //////////////////////////////////////////////////////////////////////////////// @@ -361,8 +364,11 @@ const std::string CLI::getFilter () //////////////////////////////////////////////////////////////////////////////// const std::vector CLI::getWords () { - std::vector words; + // Re-analyze the arguments, but do not de-sugar or decompose any. Analysis + // only. + analyze (false); + std::vector words; std::vector ::const_iterator a; for (a = _args.begin (); a != _args.end (); ++a) { diff --git a/src/CLI.h b/src/CLI.h index 76070721a..2854b4def 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -69,7 +69,7 @@ public: void entity (const std::string&, const std::string&); void initialize (int, const char**); void add (const std::string&); - void analyze (); + void analyze (bool parse = true); const std::string getFilter (); const std::vector getWords (); const std::vector getModifications ();