CLI2: Added ::decomposeModTags

This commit is contained in:
Paul Beckingham 2015-06-21 20:43:42 -04:00
parent 706ca72a75
commit 15e9c91d85
2 changed files with 12 additions and 18 deletions

View file

@ -527,7 +527,9 @@ void CLI2::prepareFilter (bool applyContext)
/* /*
decomposeModAttributes (); decomposeModAttributes ();
decomposeModAttributeModifiers (); decomposeModAttributeModifiers ();
*/
decomposeModTags (); decomposeModTags ();
/*
decomposeModSubstitutions (); decomposeModSubstitutions ();
*/ */
@ -1637,6 +1639,7 @@ void CLI2::decomposeModAttributeModifiers ()
context.config.getInteger ("debug.parser") >= 3) context.config.getInteger ("debug.parser") >= 3)
context.debug (dump ("CLI2::analyze decomposeModAttributeModifiers")); context.debug (dump ("CLI2::analyze decomposeModAttributeModifiers"));
} }
*/
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void CLI2::decomposeModTags () void CLI2::decomposeModTags ()
@ -1644,25 +1647,13 @@ void CLI2::decomposeModTags ()
bool changes = false; bool changes = false;
for (auto& a : _args) for (auto& a : _args)
{ {
if (a.hasTag ("TERMINATOR")) if (a._lextype == Lexer::Type::tag &&
break; a.hasTag ("MODIFICATION"))
if (a.hasTag ("MODIFICATION"))
{ {
Nibbler n (a.attribute ("raw")); std::string raw = a.attribute ("raw");
std::string tag; a.attribute ("name", raw.substr (1));
std::string sign; a.attribute ("sign", raw.substr (0, 1));
changes = true;
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;
}
} }
} }
@ -1671,6 +1662,7 @@ void CLI2::decomposeModTags ()
context.debug (dump ("CLI2::analyze decomposeModTags")); context.debug (dump ("CLI2::analyze decomposeModTags"));
} }
/*
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void CLI2::decomposeModSubstitutions () void CLI2::decomposeModSubstitutions ()
{ {

View file

@ -113,7 +113,9 @@ private:
/* /*
void decomposeModAttributes (); void decomposeModAttributes ();
void decomposeModAttributeModifiers (); void decomposeModAttributeModifiers ();
*/
void decomposeModTags (); void decomposeModTags ();
/*
void decomposeModSubstitutions (); void decomposeModSubstitutions ();
bool isUUIDList (const std::string&) const; bool isUUIDList (const std::string&) const;