From d92a6c3ee88a15e2a6bf7fbdc36523693cb28075 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 20 Jun 2015 06:49:30 -0700 Subject: [PATCH] CLI2: Added ::findUUIDs --- src/CLI2.cpp | 43 +++++++++---------------------------------- src/CLI2.h | 4 ++-- 2 files changed, 11 insertions(+), 36 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 4716c2060..3b138bbc5 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -639,8 +639,8 @@ void CLI2::prepareFilter (bool applyContext) // Remove all the syntactic sugar for FILTERs. changes = false; findIDs (); -/* findUUIDs (); +/* insertIDExpr (); desugarFilterTags (); findStrayModifications (); @@ -1480,49 +1480,24 @@ void CLI2::findIDs () } } -/* //////////////////////////////////////////////////////////////////////////////// void CLI2::findUUIDs () { + bool changes = false; + for (auto& a : _args) { - if (a.hasTag ("FILTER")) + if (a.hasTag ("FILTER") && + a._lextype == Lexer::Type::uuid) { - // UUIDs have a limited character set. - std::string raw = a.attribute ("raw"); - if (raw.find_first_not_of ("0123456789abcdefABCDEF-,") == std::string::npos) - { - Nibbler n (raw); - std::vector uuidList; - std::string uuid; - if (n.getUUID (uuid) || - n.getPartialUUID (uuid)) - { - uuidList.push_back (uuid); - - while (n.skip (',')) - { - if (! n.getUUID (uuid) && - ! n.getPartialUUID (uuid)) - throw std::string (STRING_PARSER_UUID_AFTER_COMMA); - - uuidList.push_back (uuid); - } - - if (n.depleted ()) - { - a.tag ("UUID"); - - // Save the list. - for (auto& uuid : uuidList) - _uuid_list.push_back (uuid); - } - } - } + a.tag ("UUID"); + _uuid_list.push_back (a.attribute ("raw")); + changes = true; } } } +/* //////////////////////////////////////////////////////////////////////////////// void CLI2::insertIDExpr () { diff --git a/src/CLI2.h b/src/CLI2.h index 517afcd8b..38ec3648e 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -122,8 +122,8 @@ private: void desugarFilterPatterns (); */ void findIDs (); -/* void findUUIDs (); +/* void insertIDExpr (); void desugarFilterPlainArgs (); void findOperators (); @@ -163,8 +163,8 @@ public: std::vector _args; std::vector > _id_ranges; -/* std::vector _uuid_list; +/* bool _strict; bool _terminated; */