return expr;
}
private Expression conditionalOp(ExprData data) throws TemplateException {
Expression expr = impOp(data);
if (data.cfml.forwardIfCurrent('?')) {
comments(data);
// Elvis
if(data.cfml.forwardIfCurrent(':')) {
comments(data);
Expression right = assignOp(data);
if(!(expr instanceof Variable) )
throw new TemplateException(data.cfml,"left operant of the Elvis operator has to be a variable or a function call");
return OpElvis.toExpr((Variable)expr, right);
}
Expression left = assignOp(data);
comments(data);
if(!data.cfml.forwardIfCurrent(':'))throw new TemplateException("invalid conditional operator");
comments(data);
Expression right = assignOp(data);
expr=OpContional.toExpr(expr, left, right);
}
return expr;
}