CLI
- ::unsweetenPatterns no longer clobbers non-FILTER args.
This commit is contained in:
41
src/CLI.cpp
41
src/CLI.cpp
@@ -813,27 +813,32 @@ void CLI::unsweetenPatterns ()
|
|||||||
std::vector <A>::iterator a;
|
std::vector <A>::iterator a;
|
||||||
for (a = _args.begin (); a != _args.end (); ++a)
|
for (a = _args.begin (); a != _args.end (); ++a)
|
||||||
{
|
{
|
||||||
Nibbler n (a->attribute ("raw"));
|
if (a->hasTag ("FILTER"))
|
||||||
std::string pattern;
|
|
||||||
|
|
||||||
if (n.getQuoted ('/', pattern) &&
|
|
||||||
n.depleted () &&
|
|
||||||
pattern.length () > 0)
|
|
||||||
{
|
{
|
||||||
A lhs ("argPattern", "description");
|
Nibbler n (a->attribute ("raw"));
|
||||||
lhs.tag ("ATT");
|
std::string pattern;
|
||||||
lhs.tag ("FILTER");
|
|
||||||
reconstructed.push_back (lhs);
|
|
||||||
|
|
||||||
A op ("argPattern", "~");
|
if (n.getQuoted ('/', pattern) &&
|
||||||
op.tag ("OP");
|
n.depleted () &&
|
||||||
op.tag ("FILTER");
|
pattern.length () > 0)
|
||||||
reconstructed.push_back (op);
|
{
|
||||||
|
A lhs ("argPattern", "description");
|
||||||
|
lhs.tag ("ATT");
|
||||||
|
lhs.tag ("FILTER");
|
||||||
|
reconstructed.push_back (lhs);
|
||||||
|
|
||||||
A rhs ("argPattern", "'" + pattern + "'");
|
A op ("argPattern", "~");
|
||||||
rhs.tag ("LITERAL");
|
op.tag ("OP");
|
||||||
rhs.tag ("FILTER");
|
op.tag ("FILTER");
|
||||||
reconstructed.push_back (rhs);
|
reconstructed.push_back (op);
|
||||||
|
|
||||||
|
A rhs ("argPattern", "'" + pattern + "'");
|
||||||
|
rhs.tag ("LITERAL");
|
||||||
|
rhs.tag ("FILTER");
|
||||||
|
reconstructed.push_back (rhs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
reconstructed.push_back (*a);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
reconstructed.push_back (*a);
|
reconstructed.push_back (*a);
|
||||||
|
|||||||
Reference in New Issue
Block a user