diff --git a/src/CLI.cpp b/src/CLI.cpp index 0f72f8a67..1ee6d446d 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -341,6 +341,7 @@ void CLI::analyze (bool parse /* = true */, bool strict /* = false */) findUUIDs (); insertIDExpr (); desugarTags (); + findStrayModifications (); desugarAttributes (); desugarAttributeModifiers (); desugarPatterns (); @@ -907,6 +908,32 @@ void CLI::desugarTags () } } +//////////////////////////////////////////////////////////////////////////////// +void CLI::findStrayModifications () +{ + bool changes = false; + + std::string command = getCommand (); + if (command == "add" || + command == "log") + { + std::vector ::iterator a; + for (a = _args.begin (); a != _args.end (); ++a) + { + if (a->hasTag ("FILTER")) + { + a->unTag ("FILTER"); + a->tag ("MODIFICATION"); + changes = true; + } + } + } + + if (changes) + if (context.config.getInteger ("debug.parser") >= 3) + context.debug (context.cli.dump ("CLI::analyze findStrayModifications")); +} + //////////////////////////////////////////////////////////////////////////////// // :['"][]['"] --> name = value void CLI::desugarAttributes () diff --git a/src/CLI.h b/src/CLI.h index 20df68978..68987c695 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -93,6 +93,7 @@ private: void categorize (); bool exactMatch (const std::string&, const std::string&) const; void desugarTags (); + void findStrayModifications (); void desugarAttributes (); void desugarAttributeModifiers (); void desugarPatterns ();