rubyx/lib/risc/position/code_position.rb
Torsten Ruger bc1e29e4f6 seperate different Position classes into own files
also tests
and have Position module keep all positions
(singletons should be at module, not class level)
2018-05-10 20:56:12 +03:00

23 lines
487 B
Ruby

module Risc
module Position
class CodePosition < ObjectPosition
attr_reader :code , :method
def initialize(code, pos , method)
super(pos)
@code = code
@method = method
end
def init(at)
return unless code.next
Position.set(code.next , at + code.padded_length, method)
end
def reset_to(pos)
super(pos)
#puts "Reset (#{changed}) #{instruction}"
init(pos)
end
end
end
end