public BuiltExpression[] CompileList(Block cb, ExprNode e) { BuiltExpression[] args; if (e is EmptyNode) { args = new BuiltExpression[0]; } else if (e is CommaNode cn) { args = cn.Values.Select(x => Compile(cb, x)).ToArray(); } else { args = new[] { Compile(cb, e) } }; return(args); }
protected object RunExpr(VarCtx ctx, BuiltExpression e) { if (!CompiledCode.ContainsKey(e)) { CompiledCode[e] = Expression.Lambda(e.Expr, RuntimeVarCtx).Compile(); } ctx.Interp.IrqPoll(); ctx.Interp.Gas -= 1; ctx.PC = e; try { return(CompiledCode[e].DynamicInvoke(ctx)); } catch (Exception ee) { //ctx.Interp.SyncDebug(ee); Throw(ctx, new RuntimeException(ee.Message, ctx)); return(Undefined); } }
public void EAdd(BuiltExpression e) { Exprs.Add(e); }
public StackLocation(FuncCtx f, BuiltExpression e) { Func = f; PC = e; }