Ejemplo n.º 1
0
 public Expression UnaryArifm(Expression a, ArifmOperation op)
 {
     if (a.Type.IsPrimitive)
     {
         a = Expression.Convert(a, typeof(object));
     }
     return(Expression.Invoke(Const((Func <VarCtx, object, object, object>)op.Arifm), RuntimeVarCtx, a, Const(null)));
 }
Ejemplo n.º 2
0
 public Expression Arifm(Expression a, Expression b, ArifmOperation op)
 {
     if (a.Type.IsPrimitive)
     {
         a = Expression.Convert(a, typeof(object));
     }
     if (b.Type.IsPrimitive)
     {
         b = Expression.Convert(b, typeof(object));
     }
     return(Expression.Invoke(Const((Func <VarCtx, object, object, object>)op.Arifm), RuntimeVarCtx, a, b));
     //return Expression.Invoke(Const((Func<VarCtx, ArifmOperation, object, object, object>)ArifmProxy), RuntimeVarCtx, Const(op), a, b);
 }
Ejemplo n.º 3
0
 public Expression EAssignDictArifm(Expression dict, Expression name, Expression val, ArifmOperation op, bool retOriginal)
 {
     return(Expression.Invoke(Const((Func <VarCtx, object, object, object, object>) new SetDictArifm {
         op = op, retOriginal = retOriginal
     }.Apply), RuntimeVarCtx,
                              Expression.Convert(dict, typeof(object)), Expression.Convert(name, typeof(object)), val == null ? Const(null) : Expression.Convert(val, typeof(object))));
 }
Ejemplo n.º 4
0
 public Expression EAssignVarArifm(string name, Expression val, ArifmOperation op, bool retOriginal)
 {
     return(Expression.Invoke(Const((Func <VarCtx, object, object>) new SetValArifm {
         key = name, op = op, retOriginal = retOriginal
     }.Apply), RuntimeVarCtx, val == null ? Const(null) : Expression.Convert(val, typeof(object))));
 }