Search in sources :

Example 1 with BigPlus

use of lucee.runtime.interpreter.ref.op.BigPlus in project Lucee by lucee.

the class CFMLExpressionInterpreter method _plus.

private Ref _plus(Ref ref) throws PageException {
    // +=
    if (cfml.isCurrent('=')) {
        cfml.next();
        cfml.removeSpace();
        Ref right = assignOp();
        Ref res = preciseMath ? new BigPlus(ref, right, limited) : new Plus(ref, right, limited);
        ref = new Assign(ref, res, limited);
    } else {
        cfml.removeSpace();
        ref = preciseMath ? new BigPlus(ref, modOp(), limited) : new Plus(ref, modOp(), limited);
    }
    return ref;
}
Also used : Ref(lucee.runtime.interpreter.ref.Ref) BigPlus(lucee.runtime.interpreter.ref.op.BigPlus) Assign(lucee.runtime.interpreter.ref.var.Assign) DynAssign(lucee.runtime.interpreter.ref.var.DynAssign) Plus(lucee.runtime.interpreter.ref.op.Plus) BigPlus(lucee.runtime.interpreter.ref.op.BigPlus)

Example 2 with BigPlus

use of lucee.runtime.interpreter.ref.op.BigPlus in project Lucee by lucee.

the class CFMLExpressionInterpreter method _unaryOp.

private Ref _unaryOp(Ref ref, boolean isPlus) throws PageException {
    cfml.removeSpace();
    Ref res = preciseMath ? new BigPlus(ref, isPlus ? PLUS_ONE : MINUS_ONE, limited) : new Plus(ref, isPlus ? PLUS_ONE : MINUS_ONE, limited);
    ref = new Assign(ref, res, limited);
    return preciseMath ? new BigPlus(ref, isPlus ? MINUS_ONE : PLUS_ONE, limited) : new Plus(ref, isPlus ? MINUS_ONE : PLUS_ONE, limited);
}
Also used : Ref(lucee.runtime.interpreter.ref.Ref) BigPlus(lucee.runtime.interpreter.ref.op.BigPlus) Assign(lucee.runtime.interpreter.ref.var.Assign) DynAssign(lucee.runtime.interpreter.ref.var.DynAssign) Plus(lucee.runtime.interpreter.ref.op.Plus) BigPlus(lucee.runtime.interpreter.ref.op.BigPlus)

Example 3 with BigPlus

use of lucee.runtime.interpreter.ref.op.BigPlus in project Lucee by lucee.

the class CFMLExpressionInterpreter method negateMinusOp.

/**
 * Liest die Vordlobe einer Zahl ein
 * @return CFXD Element
 * @throws PageException
 */
private Ref negateMinusOp() throws PageException {
    // And Operation
    if (cfml.forwardIfCurrent('-')) {
        if (cfml.forwardIfCurrent('-')) {
            cfml.removeSpace();
            Ref expr = clip();
            Ref res = preciseMath ? new BigMinus(expr, new LNumber(new Double(1)), limited) : new Minus(expr, new LNumber(new Double(1)), limited);
            return new Assign(expr, res, limited);
        }
        cfml.removeSpace();
        return new Negate(clip(), limited);
    }
    if (cfml.forwardIfCurrent('+')) {
        if (cfml.forwardIfCurrent('+')) {
            cfml.removeSpace();
            Ref expr = clip();
            Ref res = preciseMath ? new BigPlus(expr, new LNumber(new Double(1)), limited) : new Plus(expr, new LNumber(new Double(1)), limited);
            return new Assign(expr, res, limited);
        }
        cfml.removeSpace();
        return new Casting("numeric", CFTypes.TYPE_NUMERIC, clip());
    }
    return clip();
}
Also used : Casting(lucee.runtime.interpreter.ref.cast.Casting) Ref(lucee.runtime.interpreter.ref.Ref) LNumber(lucee.runtime.interpreter.ref.literal.LNumber) BigPlus(lucee.runtime.interpreter.ref.op.BigPlus) Assign(lucee.runtime.interpreter.ref.var.Assign) DynAssign(lucee.runtime.interpreter.ref.var.DynAssign) Negate(lucee.runtime.interpreter.ref.op.Negate) Plus(lucee.runtime.interpreter.ref.op.Plus) BigPlus(lucee.runtime.interpreter.ref.op.BigPlus) BigMinus(lucee.runtime.interpreter.ref.op.BigMinus) BigMinus(lucee.runtime.interpreter.ref.op.BigMinus) Minus(lucee.runtime.interpreter.ref.op.Minus)

Aggregations

Ref (lucee.runtime.interpreter.ref.Ref)3 BigPlus (lucee.runtime.interpreter.ref.op.BigPlus)3 Plus (lucee.runtime.interpreter.ref.op.Plus)3 Assign (lucee.runtime.interpreter.ref.var.Assign)3 DynAssign (lucee.runtime.interpreter.ref.var.DynAssign)3 Casting (lucee.runtime.interpreter.ref.cast.Casting)1 LNumber (lucee.runtime.interpreter.ref.literal.LNumber)1 BigMinus (lucee.runtime.interpreter.ref.op.BigMinus)1 Minus (lucee.runtime.interpreter.ref.op.Minus)1 Negate (lucee.runtime.interpreter.ref.op.Negate)1