Example #1
0
 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);
 }
Example #2
0
 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);
     }
 }
Example #3
0
 public void EAdd(BuiltExpression e)
 {
     Exprs.Add(e);
 }
Example #4
0
 public StackLocation(FuncCtx f, BuiltExpression e)
 {
     Func = f;
     PC   = e;
 }