class SyntaxTree::YARV::GetBlockParam
~~~
end
block
def foo(&block)
~~~ruby
### Usage
stack.
to the current method. It pushes the value of the block local onto the
The local it retrieves, however, is a special block local that was passed
walks recursively up the parent instruction sequences until it finds it.
for a local variable in the current instruction sequence’s local table and
`getblockparam` is a similar instruction to ‘getlocal` in that it looks
### Summary
def ==(other)
def ==(other) other.is_a?(GetBlockParam) && other.index == index && other.level == level end
def call(vm)
def call(vm) vm.push(vm.local_get(index, level)) end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { index: index, level: level } end
def disasm(fmt)
def disasm(fmt) fmt.instruction("getblockparam", [fmt.local(index, explicit: level)]) end
def initialize(index, level)
def initialize(index, level) @index = index @level = level end
def length
def length 3 end
def pushes
def pushes 1 end
def to_a(iseq)
def to_a(iseq) current = iseq level.times { current = iseq.parent_iseq } [:getblockparam, current.local_table.offset(index), level] end