CLI2: Added special case handling for '<name>:<value>', using operator '='
- By adding the special case, the desugarFilterAttributes and desugarFilterAttributeModifiers methods can be merged.
This commit is contained in:
18
src/CLI2.cpp
18
src/CLI2.cpp
@@ -953,10 +953,6 @@ void CLI2::desugarFilterAttributes ()
|
|||||||
if (! canonicalize (canonical, "attribute", name))
|
if (! canonicalize (canonical, "attribute", name))
|
||||||
canonicalize (canonical, "uda", name);
|
canonicalize (canonical, "uda", name);
|
||||||
|
|
||||||
// <name>:<value> is an assumed <name> is <value>
|
|
||||||
if (mod == "")
|
|
||||||
mod = "is";
|
|
||||||
|
|
||||||
// TODO The "!" modifier is being dropped.
|
// TODO The "!" modifier is being dropped.
|
||||||
|
|
||||||
A2 lhs (name, Lexer::Type::dom);
|
A2 lhs (name, Lexer::Type::dom);
|
||||||
@@ -970,7 +966,13 @@ void CLI2::desugarFilterAttributes ()
|
|||||||
A2 rhs ("", Lexer::Type::string);
|
A2 rhs ("", Lexer::Type::string);
|
||||||
rhs.tag ("FILTER");
|
rhs.tag ("FILTER");
|
||||||
|
|
||||||
if (mod == "before" || mod == "under" || mod == "below")
|
// Special case for '<name>:<value>'.
|
||||||
|
if (mod == "")
|
||||||
|
{
|
||||||
|
op.attribute ("raw", "=");
|
||||||
|
rhs.attribute ("raw", value);
|
||||||
|
}
|
||||||
|
else if (mod == "before" || mod == "under" || mod == "below")
|
||||||
{
|
{
|
||||||
op.attribute ("raw", "<");
|
op.attribute ("raw", "<");
|
||||||
rhs.attribute ("raw", value);
|
rhs.attribute ("raw", value);
|
||||||
@@ -1051,12 +1053,6 @@ void CLI2::desugarFilterAttributes ()
|
|||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
std::string operatorLiteral = "=";
|
|
||||||
if (canonical == "status")
|
|
||||||
operatorLiteral = "==";
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
changes = true;
|
changes = true;
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user