diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 122991391..74fbfff8a 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -913,8 +913,8 @@ void CLI2::desugarFilterTags () std::vector reconstructed; for (auto& a : _args) { - if (a.hasTag ("FILTER") && - a._lextype == Lexer::Type::tag) + if (a._lextype == Lexer::Type::tag && + a.hasTag ("FILTER")) { changes = true; @@ -978,8 +978,8 @@ void CLI2::desugarFilterAttributes () std::vector reconstructed; for (auto& a : _args) { - if (a.hasTag ("FILTER") && - a._lextype == Lexer::Type::pair) + if (a._lextype == Lexer::Type::pair && + a.hasTag ("FILTER")) { changes = true; @@ -1159,8 +1159,8 @@ void CLI2::desugarFilterPatterns () std::vector reconstructed; for (auto& a : _args) { - if (a.hasTag ("FILTER") && - a._lextype == Lexer::Type::pattern) + if (a._lextype == Lexer::Type::pattern && + a.hasTag ("FILTER")) { changes = true; std::string raw = a.attribute ("raw"); @@ -1292,8 +1292,8 @@ void CLI2::findUUIDs () { for (auto& a : _args) { - if (a.hasTag ("FILTER") && - a._lextype == Lexer::Type::uuid) + if (a._lextype == Lexer::Type::uuid && + a.hasTag ("FILTER")) { _uuid_list.push_back (a.attribute ("raw")); } @@ -1303,8 +1303,8 @@ void CLI2::findUUIDs () { for (auto& a : _args) { - if (a.hasTag ("MODIFICATION") && - a._lextype == Lexer::Type::uuid) + if (a._lextype == Lexer::Type::uuid && + a.hasTag ("MODIFICATION")) { a.unTag ("MODIFICATION"); a.tag ("FILTER"); @@ -1334,10 +1334,10 @@ void CLI2::insertIDExpr () std::vector reconstructed; for (auto& a : _args) { - if (a.hasTag ("FILTER") && - (a._lextype == Lexer::Type::set || + if ((a._lextype == Lexer::Type::set || a._lextype == Lexer::Type::number || - a._lextype == Lexer::Type::uuid)) + a._lextype == Lexer::Type::uuid) && + a.hasTag ("FILTER")) { if (! foundID) { @@ -1745,30 +1745,4 @@ void CLI2::decomposeModSubstitutions () context.debug (dump ("CLI2::prepareFilter decomposeModSubstitutions")); } -/* -//////////////////////////////////////////////////////////////////////////////// -bool CLI2::isUUIDList (const std::string& raw) const -{ - // UUIDs have a limited character set. - if (raw.find_first_not_of ("0123456789abcdefABCDEF-,") == std::string::npos) - { - Nibbler n (raw); - std::string token; - if (n.getUUID (token) || - n.getPartialUUID (token)) - { - while (n.skip (',')) - if (! n.getUUID (token) && - ! n.getPartialUUID (token)) - return false; - - if (n.depleted ()) - return true; - } - } - - return false; -} -*/ - //////////////////////////////////////////////////////////////////////////////// diff --git a/src/CLI2.h b/src/CLI2.h index 6fe41d5fb..fd887ee18 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -105,10 +105,6 @@ private: void decomposeModTags (); void decomposeModSubstitutions (); -/* - bool isUUIDList (const std::string&) const; -*/ - public: std::multimap _entities; std::map _aliases;