expr=_unaryOp(data,expr,OpDouble.MINUS);
return expr;
}
private Expression _unaryOp(ExprData data,Expression expr,int opr) throws TemplateException {
Position leftEnd = expr.getEnd(),start=null,end=null;
comments(data);
if(leftEnd!=null){
start=leftEnd;
end=new Position(leftEnd.line, leftEnd.column+2, leftEnd.pos+2);
}
ExprDouble res = OpDouble.toExprDouble(expr, LitDouble.toExprDouble(1D,start,end),opr);
expr=new OpVariable((Variable)expr,res);
return OpDouble.toExprDouble(expr,LitDouble.toExprDouble(1D,start,end),opr==OpDouble.PLUS? OpDouble.MINUS:OpDouble.PLUS);