remove booted flag
just boot if needed
This commit is contained in:
parent
f1b09ac58d
commit
606c7bf906
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
23
test/parfait/test_compat.rb
Normal file
23
test/parfait/test_compat.rb
Normal file
@ -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
|
@ -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
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user