rubyx/lib/slot_machine/instruction/jump.rb
Torsten Rüger c43436f35a Change Mom to SlotMachine
rather large commit, but essentially a simple rename
Rationale in docs and blogs
2019-10-03 20:55:41 +03:00

21 lines
402 B
Ruby

module Mom
# Branch jump to the Label given
# Eg used at the end of while or end of if_true branch
#
# Risc equivalent is the same really, called Branch there.
#
class Jump < Instruction
attr_reader :label
def initialize(label)
@label = label
end
def to_risc(compiler)
compiler.add_code Risc::Branch.new(self , @label.risc_label(compiler))
end
end
end