diff --git a/Operand.cpp b/Operand.cpp index 3d6f44e..ca4c94f 100644 --- a/Operand.cpp +++ b/Operand.cpp @@ -124,9 +124,26 @@ namespace jet { } else throw coreutils::Exception("Expecting ) at end of TOLOWER expression."); } else if(in.ifNextIgnoreCase("REVERSE")) { - + if(!in.ifNext("(")) + throw coreutils::Exception("Expecting ( for REVERSE parameters."); + Operand parm1(in, tag); + if(in.ifNext(")")) { + std::string reversed = parm1.string.str(); + std::reverse(reversed.begin(), reversed.end()); + string = reversed; + } else + throw coreutils::Exception("Expecting ) at end of REVERSE expression."); } else if(in.ifNextIgnoreCase("CONCAT")) { - + if(!in.ifNext("(")) + throw coreutils::Exception("Expecting ( for CONCAT parameters."); + Operand parm1(in, tag); + string = parm1.string; + while(in.ifNext(",")) { + Operand parm(in, tag); + string << parm.string; + } + if(!in.ifNext(")")) + throw coreutils::Exception("Expecting ) at end of CONCAT expression."); } else if(in.ifNextIgnoreCase("INTEGER")) { if(!in.ifNext("(")) throw coreutils::Exception("Expecting ( for INTEGER parameters.");