From f5ece63ec0659291c029e170dcfdd590b6eaf9ee Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 5 Jul 2015 16:29:54 -0400 Subject: [PATCH] CLI2: Removed obsolete ::decomposeModAttributes --- src/CLI2.cpp | 49 ------------------------------------------------- src/CLI2.h | 1 - 2 files changed, 50 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 8a43c37df..47a5ac317 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -638,7 +638,6 @@ void CLI2::prepareFilter (bool applyContext) insertJunctions (); // Deliberately after all desugar calls. // Decompose the elements for MODIFICATIONs. - //decomposeModAttributes (); //decomposeModTags (); //decomposeModSubstitutions (); } @@ -1698,54 +1697,6 @@ void CLI2::defaultCommand () context.debug (dump ("CLI2::analyze defaultCommand")); } -//////////////////////////////////////////////////////////////////////////////// -void CLI2::decomposeModAttributes () -{ - bool changes = false; - for (auto& a : _args) - { - if (a._lextype == Lexer::Type::pair && - a.hasTag ("MODIFICATION")) - { - changes = true; - auto raw = a.attribute ("raw"); - auto colon = raw.find (':'); - auto equal = raw.find ('='); - - // Q: Which of ':', '=' is the separator? - // A: Whichever comes first. For example: - // name:a=b - // name=a:b - // Both are valid, and 'name' is the attribute name in each case. - std::string::size_type separator = std::min (colon, equal); - std::string name = raw.substr (0, separator); - std::string value = raw.substr (separator + 1); - - std::string canonical; - if (canonicalize (canonical, "attribute", name) || - canonicalize (canonical, "uda", name)) - { - a.attribute ("canonical", canonical); - a.attribute ("name", name); - a.attribute ("value", value); - } - - // If the name does not canonicalize to either an attribute or a UDA - // then it is not a recognized Lexer::Type::pair, so downgrade it to - // Lexer::Type::word. - else - { - a._lextype = Lexer::Type::word; - continue; - } - } - } - - if (changes && - context.config.getInteger ("debug.parser") >= 3) - context.debug (dump ("CLI2::prepareFilter decomposeModAttributes")); -} - //////////////////////////////////////////////////////////////////////////////// void CLI2::decomposeModTags () { diff --git a/src/CLI2.h b/src/CLI2.h index 6725dfb54..83e2292e5 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -104,7 +104,6 @@ private: void desugarFilterPlainArgs (); void insertJunctions (); void defaultCommand (); - void decomposeModAttributes (); void decomposeModTags (); void decomposeModSubstitutions ();