rubyx/lib/register/instructions/branch.rb
2015-07-24 13:23:56 +03:00

20 lines
288 B
Ruby

module Register
# a branch must branch to a block.
class Branch < Instruction
def initialize source , to
super(source)
raise "No block" unless to
@block = to
end
attr_reader :block
def to_s
"Branch(block: #{block.name})"
end
end
end