CLI
- Updated ::desugarAttributes to properly handle UDA and PSEUDO args. - Cleaned up handling or ATTRIBUTE.
This commit is contained in:
44
src/CLI.cpp
44
src/CLI.cpp
@@ -681,21 +681,32 @@ void CLI::desugarAttributes ()
|
|||||||
std::string canonical;
|
std::string canonical;
|
||||||
if (canonicalize (canonical, "uda", name))
|
if (canonicalize (canonical, "uda", name))
|
||||||
{
|
{
|
||||||
A left ("argUDA", name);
|
A lhs ("argUDA", name);
|
||||||
left.attribute ("name", canonical);
|
lhs.attribute ("name", canonical);
|
||||||
left.tag ("UDA");
|
lhs.tag ("UDA");
|
||||||
left.tag ("MODIFIABLE");
|
lhs.tag ("ATTRIBUTE");
|
||||||
left.tag ("FILTER");
|
lhs.tag ("FILTER");
|
||||||
reconstructed.push_back (left);
|
|
||||||
|
A op ("argUDA", "=");
|
||||||
|
op.tag ("OP");
|
||||||
|
op.tag ("FILTER");
|
||||||
|
|
||||||
|
A rhs ("argUDA", value);
|
||||||
|
rhs.tag ("LITERAL");
|
||||||
|
rhs.tag ("FILTER");
|
||||||
|
|
||||||
|
reconstructed.push_back (lhs);
|
||||||
|
reconstructed.push_back (op);
|
||||||
|
reconstructed.push_back (rhs);
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (canonicalize (canonical, "pseudo", name))
|
else if (canonicalize (canonical, "pseudo", name))
|
||||||
{
|
{
|
||||||
A left ("argUDA", name);
|
A lhs ("argPseudo", name);
|
||||||
left.attribute ("name", canonical);
|
lhs.attribute ("name", canonical);
|
||||||
left.tag ("PSEUDO");
|
lhs.tag ("PSEUDO");
|
||||||
reconstructed.push_back (left);
|
reconstructed.push_back (lhs);
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,19 +717,16 @@ void CLI::desugarAttributes ()
|
|||||||
lhs.tag ("ATTRIBUTE");
|
lhs.tag ("ATTRIBUTE");
|
||||||
lhs.tag ("FILTER");
|
lhs.tag ("FILTER");
|
||||||
|
|
||||||
std::map <std::string, Column*>::const_iterator col;
|
std::string operatorLiteral = "=";
|
||||||
col = context.columns.find (canonical);
|
if (canonical == "status")
|
||||||
if (col != context.columns.end () &&
|
operatorLiteral = "==";
|
||||||
col->second->modifiable ())
|
|
||||||
{
|
|
||||||
lhs.tag ("MODIFIABLE");
|
|
||||||
}
|
|
||||||
|
|
||||||
A op ("argAtt", "=");
|
A op ("argAtt", operatorLiteral);
|
||||||
op.tag ("OP");
|
op.tag ("OP");
|
||||||
op.tag ("FILTER");
|
op.tag ("FILTER");
|
||||||
|
|
||||||
A rhs ("argAtt", value);
|
A rhs ("argAtt", value);
|
||||||
|
rhs.tag ("LITERAL");
|
||||||
rhs.tag ("FILTER");
|
rhs.tag ("FILTER");
|
||||||
|
|
||||||
reconstructed.push_back (lhs);
|
reconstructed.push_back (lhs);
|
||||||
|
|||||||
Reference in New Issue
Block a user