move position module to folder

This commit is contained in:
Torsten Ruger 2018-05-31 19:01:10 +03:00
parent 49849939a1
commit 2544bc5a85
3 changed files with 8 additions and 6 deletions

View File

@ -20,7 +20,7 @@ module Risc
end end
require_relative "risc/padding" require_relative "risc/padding"
require_relative "risc/position" require_relative "risc/position/position"
require_relative "risc/platform" require_relative "risc/platform"
require "parfait" require "parfait"
require_relative "risc/parfait_adapter" require_relative "risc/parfait_adapter"

View File

@ -82,7 +82,9 @@ module Risc
log.debug "Setting #{pos.to_s(16)} for #{object.class}-#{object}" log.debug "Setting #{pos.to_s(16)} for #{object.class}-#{object}"
testing = self.at( pos ) testing = self.at( pos )
position = for_at( object , pos , extra) position = for_at( object , pos , extra)
raise "Mismatch (at #{pos.to_s(16)}) was:#{position} #{position.class} #{position.object} , should #{testing}#{testing.class}" if testing and testing.class != position.class if testing and testing.class != position.class
raise "Mismatch (at #{pos.to_s(16)}) was:#{position} #{position.class} #{position.object} , should #{testing}#{testing.class}"
end
self.positions[object] = position self.positions[object] = position
position.init(pos , extra) position.init(pos , extra)
@reverse_cache[position.at] = position unless object.is_a? Label @reverse_cache[position.at] = position unless object.is_a? Label
@ -102,6 +104,6 @@ module Risc
end end
end end
end end
require_relative "position/object_position" require_relative "object_position"
require_relative "position/instruction_position" require_relative "instruction_position"
require_relative "position/code_position" require_relative "code_position"

View File

@ -1,4 +1,4 @@
require_relative "helper" require_relative "../helper"
module Risc module Risc
class TestMachinePositions < MiniTest::Test class TestMachinePositions < MiniTest::Test