diff --git a/lib/risc/machine.rb b/lib/risc/machine.rb index efe19e53..654cec99 100644 --- a/lib/risc/machine.rb +++ b/lib/risc/machine.rb @@ -17,14 +17,13 @@ module Risc log_level :info def initialize - @booted = false @risc_init = nil @constants = [] @next_address = nil end - + attr_reader :constants , :cpu_init - attr_reader :booted , :translated + attr_reader :translated attr_reader :platform # Translate code to whatever cpu is specified. @@ -169,7 +168,6 @@ module Risc @objects = nil @translated = false boot_parfait! - @booted = true self end diff --git a/lib/vool/vool_compiler.rb b/lib/vool/vool_compiler.rb index ed8a73ca..0c3deedf 100644 --- a/lib/vool/vool_compiler.rb +++ b/lib/vool/vool_compiler.rb @@ -9,10 +9,7 @@ module Vool statements.to_mom(nil) statements end - def self.ruby_to_mom(source) - statements = self.ruby_to_vool(source) - statements.to_mom(nil) - end + def self.ruby_to_binary(source , platform = :arm) machine = Risc.machine.boot self.ruby_to_vool(source) diff --git a/test/parfait/test_compat.rb b/test/parfait/test_compat.rb new file mode 100644 index 00000000..365a0d59 --- /dev/null +++ b/test/parfait/test_compat.rb @@ -0,0 +1,23 @@ +require_relative "helper" + +module Parfait + class TestCompat < MiniTest::Test + + def setup + Risc.machine.boot + end + + def test_list_create_from_array + array = [1,2,3] + list = Parfait.new_list(array) + assert_equal array , list.to_a + end + + def test_word_create_from_string + string = "something" + word = Parfait.new_word(string) + assert_equal word , Parfait.new_word(string) + assert_equal string , word.to_string + end + end +end diff --git a/test/parfait/test_space.rb b/test/parfait/test_space.rb index 699cf9ac..bf66a765 100644 --- a/test/parfait/test_space.rb +++ b/test/parfait/test_space.rb @@ -7,9 +7,6 @@ module Parfait [:Word,:List,:Message,:NamedList,:Type,:Object,:Class,:Dictionary,:TypedMethod , :Integer] end - def test_booted - assert_equal true , @machine.booted - end def test_space_length assert_equal 8 , @space.get_type.instance_length , @space.get_type.inspect end diff --git a/test/risc/test_compat.rb b/test/risc/test_compat.rb deleted file mode 100644 index 9f52d98d..00000000 --- a/test/risc/test_compat.rb +++ /dev/null @@ -1,22 +0,0 @@ -require_relative "../helper" - - -class TestCompat < MiniTest::Test - - def setup - Risc.machine.boot unless Risc.machine.booted - end - - def test_list_create_from_array - array = [1,2,3] - list = Parfait.new_list(array) - assert_equal array , list.to_a - end - - def test_word_create_from_string - string = "something" - word = Parfait.new_word(string) - assert_equal word , Parfait.new_word(string) - assert_equal string , word.to_string - end -end