class SyntaxTree::YARV::Jump
### Summary
‘jump` unconditionally jumps to the label given as its only argument.
### Usage
~~~ruby x = 0 if x == 0
puts "0"
else
puts "2"
end ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2273 def initialize(label) @label = label end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2289 def ==(other) other.is_a?(Jump) && other.label == label end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2301 def branch_targets [label] end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2297 def call(vm) vm.jump(label) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2285 def deconstruct_keys(_keys) { label: label } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2277 def disasm(fmt) fmt.instruction("jump", [fmt.label(label)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2281 def to_a(_iseq) [:jump, label.name] end