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