Example #1
0
  public static Block newInterpretedClosure(
      ThreadContext context, IterNode iterNode, IRubyObject self) {
    Binding binding = context.currentBinding(self);
    NodeType argsNodeId = getArgumentTypeWackyHack(iterNode);

    BlockBody body =
        new InterpretedBlock(
            iterNode, Arity.procArityOf(iterNode.getVarNode()), asArgumentType(argsNodeId));
    return new Block(body, binding);
  }
Example #2
0
 @Override
 public IRubyObject call(
     ThreadContext context,
     IRubyObject self,
     RubyModule clazz,
     String name,
     IRubyObject[] args,
     Block block) {
   ARITY.checkArity(context.runtime, args);
   return nullPointer;
 }
Example #3
0
  public MethodBlock(RubyMethod method, StaticScope staticScope) {
    super(
        staticScope,
        Arity.createArity((int) method.arity().getLongValue()),
        BlockBody.SINGLE_RESTARG);

    this.method = method;
    String filename = method.getFilename();
    if (filename == null) filename = "(method)";
    this.filename = filename;
    this.line = method.getLine();
  }
Example #4
0
 public InterpretedBlock(IterNode iterNode, int argumentType) {
   this(
       iterNode, Arity.procArityOf(iterNode == null ? null : iterNode.getVarNode()), argumentType);
 }