private int GenValues(CodeGenScope s, AstNode t, int val, int extra) { int n = 0; // TODO: support splat mode // bool is_splat; if (t is ArgsNode) { ArgsNode argsNode = t.As <ArgsNode> (); foreach (var arg in argsNode.args) { Gen(s, arg, val); n++; } } if (t is ExpressionListNode) { ExpressionListNode exprList = t.As <ExpressionListNode> (); foreach (var expr in exprList.exprs) { Gen(s, expr, val); n++; } } return(n); }
public ForNode(AstNode var, AstNode obj, ExpressionListNode body) { this.var = var; this.obj = obj; this.body = body; args = new ArgsNode(); args.Push(var); }
public BlockNode(ArgsNode args, ExpressionListNode body) { car = args; cdr = body; }
public DefNode(AstNode name, ArgsNode args, ExpressionListNode body) { this.name = name; this.args = args; this.body = body; }
public BlockFunction(ArgsNode argumentNames, ExpressionListNode body, RubyContext context) { this.argumentNames = argumentNames; this.body = body; this.context = context; }
public DefinedFunction(ExpressionListNode body, ArgsNode parameters, RubyContext context) { this.body = body; this.context = context; this.parameters = parameters; }