public class InterpretedBlock extends ContextAwareBlockBody
SharedScopeBlock, CompiledBlock| Modifier and Type | Field and Description |
|---|---|
protected Assigner |
assigner
Logic for assigning the blocks local variables
|
private Node |
bodyNode
The body of the block, pulled out of bodyNode
|
private java.lang.String |
file
Filename from position
|
private int |
line
Line from position
|
private boolean |
noargblock
This block has no arguments at all (simple secondary optimization @see assignerFor for an
explanation).
|
private ISourcePosition |
position
The position for the block
|
arity, scopeargumentType, ARRAY, EMPTY_PARAMETER_LIST, MULTIPLE_ASSIGNMENT, NULL_BODY, SINGLE_RESTARG, ZERO_ARGS| Constructor and Description |
|---|
InterpretedBlock(IterNode iterNode,
Arity arity,
int argumentType) |
InterpretedBlock(IterNode iterNode,
int argumentType) |
arity, getStaticScope, post, pre, setStaticScopeasArgumentType, call, call, call, call, call, call, call, call, call, call, getArgumentType, getArgumentTypeWackyHack, getParameterList, isGiven, newArgsArrayFromArgsWithoutUnbox, newArgsArrayFromArgsWithUnbox, prepareArgumentsForCallprivate boolean noargblock
private final ISourcePosition position
private final java.lang.String file
private final int line
private final Node bodyNode
protected Assigner assigner
public InterpretedBlock(IterNode iterNode, int argumentType)
public static Block newInterpretedClosure(ThreadContext context, IterNode iterNode, IRubyObject self)
public static Block newInterpretedClosure(ThreadContext context, BlockBody body, IRubyObject self)
private void assignerFor(IterNode iter)
public IRubyObject yieldSpecific(ThreadContext context, Binding binding, Block.Type type)
yieldSpecific in class BlockBodypublic IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, Binding binding, Block.Type type)
yieldSpecific in class BlockBodypublic IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Binding binding, Block.Type type)
yieldSpecific in class BlockBodypublic IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Block.Type type)
yieldSpecific in class BlockBodypublic IRubyObject yield(ThreadContext context, Binding binding, Block.Type type)
public IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type)
public IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean alreadyArray, Binding binding, Block.Type type, Block block)
public IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type, Block block)
public IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean alreadyArray, Binding binding, Block.Type type)
yield in class BlockBodycontext - represents the current thread-specific datavalue - The value to yield, either a single value or an array of valuesself - The current selfklass - alreadyArray - do we need an array or should we assume it already is one?private IRubyObject evalBlockBody(ThreadContext context, Binding binding, IRubyObject self)
private IRubyObject prepareSelf(Binding binding)
public Node getBodyNode()
public java.lang.String getFile()
BlockBody