diff --git a/lib/risc/interpreter_platform.rb b/lib/risc/interpreter_platform.rb index caf152d1..ce9192da 100644 --- a/lib/risc/interpreter_platform.rb +++ b/lib/risc/interpreter_platform.rb @@ -19,10 +19,11 @@ module Risc 4 end def assemble(io) - io.write_unsigned_int_32(self) + pos = Position.get(self).at + io.write_unsigned_int_32(pos) end class Branch < Instruction - def first + def first #some logging assumes arm self end end diff --git a/lib/risc/position.rb b/lib/risc/position.rb index 4f75a730..71d42785 100644 --- a/lib/risc/position.rb +++ b/lib/risc/position.rb @@ -62,7 +62,7 @@ module Risc case object when Parfait::BinaryCode CodePosition.new(object,at , extra) - when Arm::Instruction , Risc::Label + when Arm::Instruction , Risc::Instruction InstructionPosition.new(object,at , extra) else ObjectPosition.new(at,object) diff --git a/test/mom/test_return_simple.rb b/test/mom/test_return_simple.rb index 778fa78e..857f702d 100644 --- a/test/mom/test_return_simple.rb +++ b/test/mom/test_return_simple.rb @@ -22,15 +22,5 @@ module Risc produced = produce_body assert_equal 5 , produced.constant.value end - def pest_cache_check - produced = produce_body - assert_equal NotSame , produced.next(3).class - assert_equal produced.next(34) , produced.next(3).label - end - def pest_check_resolve - produced = produce_body - assert_equal FunctionCall , produced.next(30).class - assert_equal :resolve_method ,produced.next(30).method.name - end end end diff --git a/test/mom/test_while_cmp.rb b/test/mom/test_while_cmp.rb index 534d95a9..f47a4152 100644 --- a/test/mom/test_while_cmp.rb +++ b/test/mom/test_while_cmp.rb @@ -49,10 +49,6 @@ module Risc assert_equal Risc::LoadConstant , produced.next(38).class assert_equal Parfait::NilClass , produced.next(38).constant.class end - def pest_nil_check - produced = produce_body - assert_equal produced.next(13) , produced.next(8).label - end def test_back_jump # should jump back to condition label produced = produce_body @@ -60,11 +56,5 @@ module Risc assert_equal produced , produced.next(44).label end - def test_merge_label - produced = produce_body - assert_equal Risc::Label , produced.next(45).class - assert produced.next(45).name.start_with?("merge_") , produced.next(29).name - end - end end diff --git a/test/risc/test_interpreter_platform.rb b/test/risc/test_interpreter_platform.rb index bcda9bb2..71d0e96d 100644 --- a/test/risc/test_interpreter_platform.rb +++ b/test/risc/test_interpreter_platform.rb @@ -18,7 +18,7 @@ module Risc assert IdentityTranslator.new end end - class TestTranslator < MiniTest::Test + class TestIdentityTranslator < MiniTest::Test def setup @machine = Risc.machine.boot @@ -44,7 +44,7 @@ module Risc all << ins end end - def test_no_risc #by assembling, risc doesnt have assemble method + def test_no_risc @machine.translate(:interpreter) @machine.position_all @machine.create_binary diff --git a/test/vool/ruby_compiler/test_basic_values.rb b/test/vool/ruby_compiler/test_basic_values.rb index 4945ee3c..41c95780 100644 --- a/test/vool/ruby_compiler/test_basic_values.rb +++ b/test/vool/ruby_compiler/test_basic_values.rb @@ -64,14 +64,14 @@ module Vool assert_equal "Word_Type" , compile( ":symbol").name end # classes fot these are not implemented in parfait yet - # def pest_nil - # assert_equal "Nil_Type" , compile( "nil").name - # end - # def pest_false - # assert_equal "False_Type" , compile( "false").name - # end - # def pest_true - # assert_equal "True_Type" , compile( "true").name - # end + def pest_nil + assert_equal "Nil_Type" , compile( "nil").name + end + def pest_false + assert_equal "False_Type" , compile( "false").name + end + def pest_true + assert_equal "True_Type" , compile( "true").name + end end end