2018-04-19 18:47:35 +02:00
|
|
|
require_relative "../helper"
|
|
|
|
|
2019-08-12 11:36:32 +02:00
|
|
|
module Mom
|
2018-04-19 18:47:35 +02:00
|
|
|
module Builtin
|
2019-08-11 13:31:00 +02:00
|
|
|
class BootTest < MiniTest::Test
|
|
|
|
def setup
|
|
|
|
Parfait.boot!(Parfait.default_test_options)
|
2019-08-22 16:52:19 +02:00
|
|
|
Builtin.compiler_for( Parfait.object_space.get_class.instance_type , Space , :main)
|
2019-08-11 13:31:00 +02:00
|
|
|
end
|
2019-08-22 16:52:19 +02:00
|
|
|
def get_int_compiler(name)
|
|
|
|
obj_type = Parfait.object_space.get_type_by_class_name(:Integer)
|
|
|
|
Builtin.compiler_for( obj_type , Integer , name)
|
|
|
|
end
|
|
|
|
def get_operator_compiler(name)
|
|
|
|
obj_type = Parfait.object_space.get_type_by_class_name(:Integer)
|
|
|
|
Builtin.operator_compiler( obj_type , name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_object_compiler(name)
|
|
|
|
obj_type = Parfait.object_space.get_type_by_class_name(:Object)
|
|
|
|
Builtin.compiler_for( obj_type , Object , name)
|
|
|
|
end
|
|
|
|
def get_word_compiler(name)
|
|
|
|
obj_type = Parfait.object_space.get_type_by_class_name(:Word)
|
|
|
|
Builtin.compiler_for( obj_type , Word , name)
|
2019-08-11 13:31:00 +02:00
|
|
|
end
|
|
|
|
end
|
2018-04-19 18:47:35 +02:00
|
|
|
end
|
|
|
|
end
|