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;
if(variableDefined("value1")) {
resolveKeyword("value1");
if(variableDefined("expr"))
throw coreutils::Exception("Either value1 or expr can be specified but not both.");
if(variableDefined("value2")) {
if(variableDefined("type")) {
} else
if(!variableDefined("type"))
throw coreutils::Exception("type expected if value1 and value2 specified.");
} else
throw coreutils::Exception("value2 required if value1 specified.");
if(!variableDefined("type"))
throw coreutils::Exception("type required for a value1 and value2 comparison.");
resolveKeyword("value2");
resolveKeyword("type");
int rc = variables["value1"].compare(variables["value2"]);
if(((variables["type"] == "eq") && (rc == 0)) ||
((variables["type"] == "ne") && (rc != 0)) ||