From 15e9c91d8526c29f0e5c1b986dfb4f6ac243716f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 21 Jun 2015 20:43:42 -0400 Subject: [PATCH] CLI2: Added ::decomposeModTags --- src/CLI2.cpp | 28 ++++++++++------------------ src/CLI2.h | 2 ++ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index f44a0916a..91613a1d0 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -527,7 +527,9 @@ void CLI2::prepareFilter (bool applyContext) /* decomposeModAttributes (); decomposeModAttributeModifiers (); +*/ decomposeModTags (); +/* decomposeModSubstitutions (); */ @@ -1637,6 +1639,7 @@ void CLI2::decomposeModAttributeModifiers () context.config.getInteger ("debug.parser") >= 3) context.debug (dump ("CLI2::analyze decomposeModAttributeModifiers")); } +*/ //////////////////////////////////////////////////////////////////////////////// void CLI2::decomposeModTags () @@ -1644,25 +1647,13 @@ void CLI2::decomposeModTags () bool changes = false; for (auto& a : _args) { - if (a.hasTag ("TERMINATOR")) - break; - - if (a.hasTag ("MODIFICATION")) + if (a._lextype == Lexer::Type::tag && + a.hasTag ("MODIFICATION")) { - Nibbler n (a.attribute ("raw")); - std::string tag; - std::string sign; - - if (n.getN (1, sign) && - (sign == "+" || sign == "-") && - n.getUntilEOS (tag) && - tag.find (' ') == std::string::npos) - { - a.attribute ("name", tag); - a.attribute ("sign", sign); - a.tag ("TAG"); - changes = true; - } + std::string raw = a.attribute ("raw"); + a.attribute ("name", raw.substr (1)); + a.attribute ("sign", raw.substr (0, 1)); + changes = true; } } @@ -1671,6 +1662,7 @@ void CLI2::decomposeModTags () context.debug (dump ("CLI2::analyze decomposeModTags")); } +/* //////////////////////////////////////////////////////////////////////////////// void CLI2::decomposeModSubstitutions () { diff --git a/src/CLI2.h b/src/CLI2.h index 962be23f2..bccca2512 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -113,7 +113,9 @@ private: /* void decomposeModAttributes (); void decomposeModAttributeModifiers (); +*/ void decomposeModTags (); +/* void decomposeModSubstitutions (); bool isUUIDList (const std::string&) const;