From 5658bb6a43c43406b91999be1c98c9e5541dd132 Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Mon, 11 Nov 2024 09:22:01 -0800 Subject: [PATCH] Upgraded if tag to use resolution keyword method. --- __if.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/__if.cpp b/__if.cpp index fa5cb5c..d59de3f 100644 --- a/__if.cpp +++ b/__if.cpp @@ -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)) ||