class SyntaxTree::YARV::BranchNil
~~~
end
puts “hi”
if x&.to_s
x = nil
~~~ruby
### Usage
the jump index and continues executing there.
If the value popped off the stack is nil, ‘branchnil` jumps to
stack: the jump condition.
`branchnil` has one argument: the jump index. It pops one value off the
### Summary
def ==(other)
def ==(other) other.is_a?(BranchNil) && other.label == label end
def branch_targets
def branch_targets [label] end
def call(vm)
def call(vm) vm.jump(label) if vm.pop.nil? end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { label: label } end
def disasm(fmt)
def disasm(fmt) fmt.instruction("branchnil", [fmt.label(label)]) end
def falls_through?
def falls_through? true end
def initialize(label)
def initialize(label) @label = label end
def length
def length 2 end
def pops
def pops 1 end
def to_a(_iseq)
def to_a(_iseq) [:branchnil, label.name] end