Upgraded if tag to use resolution keyword method.

This commit is contained in:
Brad Arant 2024-11-11 09:22:01 -08:00
parent 7cab6916c7
commit 5658bb6a43

View File

@ -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)) ||