CLI2: Removed obsolete ::decomposeModSubstitutions

This commit is contained in:
Paul Beckingham 2015-07-05 16:31:30 -04:00
parent af71af1085
commit 023fd9d38a
2 changed files with 0 additions and 33 deletions

View file

@ -636,9 +636,6 @@ void CLI2::prepareFilter (bool applyContext)
desugarFilterAttributes ();
desugarFilterPatterns ();
insertJunctions (); // Deliberately after all desugar calls.
// Decompose the elements for MODIFICATIONs.
//decomposeModSubstitutions ();
}
////////////////////////////////////////////////////////////////////////////////
@ -1697,32 +1694,3 @@ void CLI2::defaultCommand ()
}
////////////////////////////////////////////////////////////////////////////////
void CLI2::decomposeModSubstitutions ()
{
bool changes = false;
for (auto& a : _args)
{
if (a._lextype == Lexer::Type::substitution &&
a.hasTag ("MODIFICATION"))
{
std::string raw = a.attribute ("raw");
if (! Directory (raw).exists ())
{
auto slash1 = raw.find ("/");
auto slash2 = raw.find ("/", slash1 + 1);
auto slash3 = raw.find ("/", slash2 + 1);
a.attribute ("from", raw.substr (slash1 + 1, slash2 - slash1 - 1));
a.attribute ("to", raw.substr (slash2 + 1, slash3 - slash2 - 1));
a.attribute ("global", raw.substr (slash3 + 1) == "g" ? 1 : 0);
changes = true;
}
}
}
if (changes &&
context.config.getInteger ("debug.parser") >= 3)
context.debug (dump ("CLI2::prepareFilter decomposeModSubstitutions"));
}
////////////////////////////////////////////////////////////////////////////////