コード例 #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)));
 }
コード例 #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);
 }
コード例 #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))));
 }
コード例 #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))));
 }