class SyntaxTree::YARV::NewHash
~~~
end
{ key => value }
def foo(key, value)
~~~ruby
### Usage
and pushes a hash onto the stack.
stack. ‘number` needs to be even. It pops `number` elements off the stack
`newhash` puts a new hash onto the stack, using `number` elements from the
### Summary
def ==(other)
def ==(other) other.is_a?(NewHash) && other.number == number end
def call(vm)
def call(vm) vm.push(vm.pop(number).each_slice(2).to_h) end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { number: number } end
def disasm(fmt)
def disasm(fmt) fmt.instruction("newhash", [fmt.object(number)]) end
def initialize(number)
def initialize(number) @number = number end
def length
def length 2 end
def pops
def pops number end
def pushes
def pushes 1 end
def to_a(_iseq)
def to_a(_iseq) [:newhash, number] end