Upgraded if tag to use resolution keyword method.
This commit is contained in:
parent
7cab6916c7
commit
5658bb6a43
9
__if.cpp
9
__if.cpp
@ -11,17 +11,16 @@ namespace jet {
|
|||||||
bool booleanResult = false;
|
bool booleanResult = false;
|
||||||
|
|
||||||
if(variableDefined("value1")) {
|
if(variableDefined("value1")) {
|
||||||
|
resolveKeyword("value1");
|
||||||
if(variableDefined("expr"))
|
if(variableDefined("expr"))
|
||||||
throw coreutils::Exception("Either value1 or expr can be specified but not both.");
|
throw coreutils::Exception("Either value1 or expr can be specified but not both.");
|
||||||
if(variableDefined("value2")) {
|
if(variableDefined("value2")) {
|
||||||
if(variableDefined("type")) {
|
if(!variableDefined("type"))
|
||||||
|
|
||||||
} else
|
|
||||||
throw coreutils::Exception("type expected if value1 and value2 specified.");
|
throw coreutils::Exception("type expected if value1 and value2 specified.");
|
||||||
} else
|
} else
|
||||||
throw coreutils::Exception("value2 required if value1 specified.");
|
throw coreutils::Exception("value2 required if value1 specified.");
|
||||||
if(!variableDefined("type"))
|
resolveKeyword("value2");
|
||||||
throw coreutils::Exception("type required for a value1 and value2 comparison.");
|
resolveKeyword("type");
|
||||||
int rc = variables["value1"].compare(variables["value2"]);
|
int rc = variables["value1"].compare(variables["value2"]);
|
||||||
if(((variables["type"] == "eq") && (rc == 0)) ||
|
if(((variables["type"] == "eq") && (rc == 0)) ||
|
||||||
((variables["type"] == "ne") && (rc != 0)) ||
|
((variables["type"] == "ne") && (rc != 0)) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user