public EmitSyntax Ld(EmitSyntax emit, Pipe <EmitSyntax> ldFrom) { // Load start value emit = ldFrom(emit); foreach (var getter in path) { emit = emit.Call(getter); } return(emit); }
public static EmitSyntax Call(this EmitSyntax emit, SR.MethodInfo method) { var methodRef = emit.Methods.Import(method); if (method.IsStatic) { return(emit.Call(methodRef)); } else { return(emit.Callvirt(methodRef)); } }
public static EmitSyntax PrintStrLn(this EmitSyntax emit) { return(emit.Call((string x) => Console.WriteLine(x))); }
public static EmitSyntax PrintIntLn(this EmitSyntax emit) { return(emit.Call((int x) => Console.WriteLine(x))); }
public static EmitSyntax Print(this EmitSyntax emit) { return(emit.Call((object x) => Console.Write(x))); }
public static EmitSyntax CallFromLambda(this EmitSyntax emit, LambdaExpression callExpr) { var method = ExpressionUtils.GetMethodFromLambda(callExpr); return(emit.Call(method)); }
public static EmitSyntax Stprop <T, R>(this EmitSyntax emit, Expression <Func <T, R> > expr) { var property = ExpressionUtils.GetProperty(expr); return(emit.Call(property.GetSetMethod())); }