create rubyx dir and move previous vool_compiler there

This commit is contained in:
Torsten Ruger
2018-06-29 22:46:39 +03:00
parent 63dd6d9039
commit c8451d0048
32 changed files with 363 additions and 156 deletions

View File

@ -18,7 +18,7 @@ module Elf
in_space("def main(arg);#{input};end")
end
def check(input, file)
Vool::VoolCompiler.ruby_to_binary( input )
Vool::RubyXCompiler.ruby_to_binary( input )
writer = Elf::ObjectWriter.new(Risc.machine)
writer.save "test/#{file}.o"
end

View File

@ -39,7 +39,7 @@ module Mains
def compile(input , file , scp)
Risc.machine.boot
puts "Compiling test/#{file}.o" if DEBUG
Vool::VoolCompiler.ruby_to_binary( "class Space;def main(arg);#{input};end;end" )
Vool::RubyXCompiler.ruby_to_binary( "class Space;def main(arg);#{input};end;end" )
writer = Elf::ObjectWriter.new(Risc.machine)
writer.save "test/#{file}.o"
object_file = "/tmp/#{file}.o"

View File

@ -28,7 +28,7 @@ module Risc
end
def produce_instructions
assert @expect , "No output given"
Vool::VoolCompiler.ruby_to_binary as_test_main , :interpreter
Vool::RubyXCompiler.ruby_to_binary as_test_main , :interpreter
test = Parfait.object_space.get_class_by_name :Test
test.instance_type.get_method(:main).cpu_instructions
end

View File

@ -9,7 +9,7 @@ module Vool
end
def create_method
vool = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
vool = RubyXCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
vool.to_mom(nil)
test = Parfait.object_space.get_class_by_name(:Test)
test.get_method(:meth)
@ -37,24 +37,24 @@ module Vool
end
def test_creates_method_statement_in_class
clazz = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5 ;end")
clazz = RubyXCompiler.ruby_to_vool in_Test("def meth; @ivar = 5 ;end")
assert_equal MethodStatement , clazz.body.class
end
def test_method_statement_has_class
vool = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
vool = RubyXCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
clazz = vool.to_mom(nil)
assert vool.body.clazz
end
def test_parfait_class_creation
vool = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
vool = RubyXCompiler.ruby_to_vool in_Test("def meth; @ivar = 5;end")
clazz = vool.to_mom(nil)
assert_equal Parfait::Class , vool.body.clazz.class
end
def test_typed_method_instance_type
vool = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5; @ibar = 4;end")
vool = RubyXCompiler.ruby_to_vool in_Test("def meth; @ivar = 5; @ibar = 4;end")
vool.to_mom(nil)
test = Parfait.object_space.get_class_by_name(:Test)
method = test.instance_type.get_method(:meth)
@ -63,7 +63,7 @@ module Vool
end
def test_vool_method_has_one_local
vool = VoolCompiler.ruby_to_vool in_Test("def meth; local = 5 ; a = 6;end")
vool = RubyXCompiler.ruby_to_vool in_Test("def meth; local = 5 ; a = 6;end")
vool.to_mom(nil)
test = Parfait.object_space.get_class_by_name(:Test)
method = test.get_method(:meth)
@ -73,7 +73,7 @@ module Vool
end
def test_typed_method_has_one_local
vool = VoolCompiler.ruby_to_vool in_Test("def meth; local = 5 ; a = 6;end")
vool = RubyXCompiler.ruby_to_vool in_Test("def meth; local = 5 ; a = 6;end")
vool.to_mom(nil)
test = Parfait.object_space.get_class_by_name(:Test)
method = test.instance_type.get_method(:meth)

View File

@ -0,0 +1,9 @@
require_relative "../../helper"
module Vool
module RubyTests
def compile(input)
RubyX::RubyCompiler.compile(input)
end
end
end

View File

@ -2,17 +2,18 @@ require_relative "helper"
module Vool
class TestArray < MiniTest::Test
include RubyTests
def test_empty
lst = RubyCompiler.compile( "[]")
lst = compile( "[]")
assert_equal ArrayStatement , lst.class
end
def test_one
lst = RubyCompiler.compile( "[1]")
lst = compile( "[1]")
assert_equal ArrayStatement , lst.class
end
def test_two
lst = RubyCompiler.compile( "[1,2]")
lst = compile( "[1,2]")
assert_equal ArrayStatement , lst.class
end
end

View File

@ -2,76 +2,79 @@ require_relative "helper"
module Vool
class TestBasicValues < MiniTest::Test
include RubyTests
def test_self
lst = RubyCompiler.compile( "self")
lst = compile( "self")
assert_equal SelfExpression , lst.class
end
def test_nil
lst = RubyCompiler.compile( "nil")
lst = compile( "nil")
assert_equal NilConstant , lst.class
end
def test_false
lst = RubyCompiler.compile( "false")
lst = compile( "false")
assert_equal FalseConstant , lst.class
end
def test_true
lst = RubyCompiler.compile( "true")
lst = compile( "true")
assert_equal TrueConstant , lst.class
end
def test_integer
lst = RubyCompiler.compile( "123")
lst = compile( "123")
assert_equal IntegerConstant , lst.class
end
def test_string
lst = RubyCompiler.compile( "'string'")
lst = compile( "'string'")
assert_equal StringConstant , lst.class , lst.inspect
end
def test_sym
lst = RubyCompiler.compile( ":symbol")
lst = compile( ":symbol")
assert_equal SymbolConstant , lst.class , lst.inspect
end
def test_dstr
assert_raises RuntimeError do
RubyCompiler.compile( '"dstr#{self}"')
compile( '"dstr#{self}"')
end
end
def test_scope
lst = RubyCompiler.compile( "begin ; 1 ; end")
lst = compile( "begin ; 1 ; end")
assert_equal ScopeStatement , lst.class , lst.inspect
end
def test_scope_contents
lst = RubyCompiler.compile( "begin ; 1 ; end")
lst = compile( "begin ; 1 ; end")
assert_equal 1 , lst.statements.first.value
end
end
class TestBasicTypes < MiniTest::Test
include RubyTests
def setup
Risc.machine.boot
end
def compile( input )
lst = RubyCompiler.compile( input )
def compile_ct( input )
lst = compile( input )
lst.ct_type
end
def test_integer
assert_equal "Integer_Type" , compile( "123").name
assert_equal "Integer_Type" , compile_ct( "123").name
end
def test_string
assert_equal "Word_Type" , compile( "'string'").name
assert_equal "Word_Type" , compile_ct( "'string'").name
end
def test_sym
assert_equal "Word_Type" , compile( ":symbol").name
assert_equal "Word_Type" , compile_ct( ":symbol").name
end
# classes fot these are not implemented in parfait yet
def pest_nil
assert_equal "Nil_Type" , compile( "nil").name
assert_equal "Nil_Type" , compile_ct( "nil").name
end
def pest_false
assert_equal "False_Type" , compile( "false").name
assert_equal "False_Type" , compile_ct( "false").name
end
def pest_true
assert_equal "True_Type" , compile( "true").name
assert_equal "True_Type" , compile_ct( "true").name
end
end
end

View File

@ -2,10 +2,11 @@ require_relative "helper"
module Vool
class TestBlockStatement < MiniTest::Test
include RubyTests
def setup()
input = "plus_one{|arg1| arg1 + 1 } "
@lst = RubyCompiler.compile( input )
@lst = compile( input )
end
def test_method
assert_equal SendStatement , @lst.class

View File

@ -2,10 +2,11 @@ require_relative "helper"
module Vool
class TestEmptyClassStatement < MiniTest::Test
include RubyTests
def setup
input = "class Tryout < Base;end"
@lst = RubyCompiler.compile( input )
@lst = compile( input )
end
def test_compile_class
@ -27,13 +28,14 @@ module Vool
end
class TestBasicClassStatement < MiniTest::Test
include CompilerHelper
include RubyTests
def test_compile_one_method
lst = RubyCompiler.compile( in_Test("@ivar = 4") )
lst = compile( in_Test("@ivar = 4") )
assert_equal IvarAssignment , lst.body.class
end
def test_compile_two_methods
lst = RubyCompiler.compile( in_Test("false; true;") )
lst = compile( in_Test("false; true;") )
assert_equal ScopeStatement , lst.body.class
assert_equal TrueConstant , lst.body.statements[1].class
end

View File

@ -2,33 +2,34 @@ require_relative "helper"
module Vool
class HashArray < MiniTest::Test
include RubyTests
def test_empty
lst = RubyCompiler.compile( "{}")
lst = compile( "{}")
assert_equal HashStatement , lst.class
end
def test_empty_length
lst = RubyCompiler.compile( "{}")
lst = compile( "{}")
assert_equal 0 , lst.length
end
def test_one
lst = RubyCompiler.compile( "{ 1 => 2}")
lst = compile( "{ 1 => 2}")
assert_equal HashStatement , lst.class
end
def test_one_length
lst = RubyCompiler.compile( "{ 1 => 2}")
lst = compile( "{ 1 => 2}")
assert_equal 1 , lst.length
end
def test_one_pair
lst = RubyCompiler.compile( "{ 1 => 2}")
lst = compile( "{ 1 => 2}")
assert_equal 1 , lst.hash.keys.first.value
end
def test_two_length
lst = RubyCompiler.compile( "{ sym: :works , 'string_too' => 2}")
lst = compile( "{ sym: :works , 'string_too' => 2}")
assert_equal 2 , lst.length
end
def test_two_key_one
lst = RubyCompiler.compile( "{ sym: :works , 'string_too' => 2}")
lst = compile( "{ sym: :works , 'string_too' => 2}")
assert_equal :sym , lst.hash.keys.first.value
end
end

View File

@ -2,20 +2,21 @@ require_relative 'helper'
module Vool
class TestIfStatement < MiniTest::Test
include RubyTests
def basic_if
"if(10 < 12) ; true ; end"
end
def test_if_basic
lst = RubyCompiler.compile( basic_if )
lst = compile( basic_if )
assert_equal IfStatement , lst.class
end
def test_if_basic_cond
lst = RubyCompiler.compile( basic_if )
lst = compile( basic_if )
assert_equal ScopeStatement , lst.condition.class
end
def test_if_basic_branches
lst = RubyCompiler.compile( basic_if )
lst = compile( basic_if )
assert_equal TrueConstant , lst.if_true.class
assert_nil lst.if_false
end
@ -24,15 +25,15 @@ module Vool
"if(false) ; true ; else ; false; end"
end
def test_if_double
lst = RubyCompiler.compile( double_if )
lst = compile( double_if )
assert_equal IfStatement , lst.class
end
def test_if_double_cond
lst = RubyCompiler.compile( double_if )
lst = compile( double_if )
assert_equal ScopeStatement , lst.condition.class
end
def test_if_double_branches
lst = RubyCompiler.compile( double_if )
lst = compile( double_if )
assert_equal TrueConstant , lst.if_true.class
assert_equal FalseConstant, lst.if_false.class
end
@ -41,15 +42,15 @@ module Vool
"true if(false)"
end
def test_if_reverse
lst = RubyCompiler.compile( reverse_if )
lst = compile( reverse_if )
assert_equal IfStatement , lst.class
end
def test_if_reverse_cond
lst = RubyCompiler.compile( reverse_if )
lst = compile( reverse_if )
assert_equal FalseConstant , lst.condition.class
end
def test_if_reverse_branches
lst = RubyCompiler.compile( reverse_if )
lst = compile( reverse_if )
assert_equal TrueConstant , lst.if_true.class
assert_nil lst.if_false
end
@ -58,15 +59,15 @@ module Vool
"true unless(false)"
end
def test_if_reverse
lst = RubyCompiler.compile( reverse_unless )
lst = compile( reverse_unless )
assert_equal IfStatement , lst.class
end
def test_if_reverse_cond
lst = RubyCompiler.compile( reverse_unless )
lst = compile( reverse_unless )
assert_equal ScopeStatement , lst.condition.class
end
def test_if_reverse_branches
lst = RubyCompiler.compile( reverse_unless )
lst = compile( reverse_unless )
assert_nil lst.if_true
assert_equal TrueConstant ,lst.if_false.class
end
@ -75,15 +76,15 @@ module Vool
"false ? true : false"
end
def test_if_ternary
lst = RubyCompiler.compile( ternary )
lst = compile( ternary )
assert_equal IfStatement , lst.class
end
def test_if_ternary_cond
lst = RubyCompiler.compile( ternary )
lst = compile( ternary )
assert_equal FalseConstant , lst.condition.class
end
def test_if_ternary_branches
lst = RubyCompiler.compile( ternary )
lst = compile( ternary )
assert_equal TrueConstant , lst.if_true.class
assert_equal FalseConstant, lst.if_false.class
end

View File

@ -2,27 +2,28 @@ require_relative "helper"
module Vool
class TestIvarAssignment < MiniTest::Test
include RubyTests
def test_local
lst = RubyCompiler.compile( "foo = bar")
lst = compile( "foo = bar")
assert_equal LocalAssignment , lst.class
end
def test_local_name
lst = RubyCompiler.compile( "foo = bar")
lst = compile( "foo = bar")
assert_equal :foo , lst.name
end
def test_instance
lst = RubyCompiler.compile( "@foo = bar")
lst = compile( "@foo = bar")
assert_equal IvarAssignment , lst.class
end
def test_instance_name
lst = RubyCompiler.compile( "@foo = bar")
lst = compile( "@foo = bar")
assert_equal :foo , lst.name
end
def test_const
lst = RubyCompiler.compile( "@foo = 5")
lst = compile( "@foo = 5")
assert_equal IvarAssignment , lst.class
end

View File

@ -2,21 +2,22 @@ require_relative "helper"
module Vool
class TestLocalAssignment < MiniTest::Test
include RubyTests
def test_local
lst = RubyCompiler.compile( "foo = bar")
lst = compile( "foo = bar")
assert_equal LocalAssignment , lst.class
end
def test_local_name
lst = RubyCompiler.compile( "foo = bar")
lst = compile( "foo = bar")
assert_equal :foo , lst.name
end
def test_local_const
lst = RubyCompiler.compile( "foo = 5")
lst = compile( "foo = 5")
assert_equal LocalAssignment , lst.class
end
def test_local_ivar
lst = RubyCompiler.compile( "foo = @iv")
lst = compile( "foo = @iv")
assert_equal LocalAssignment , lst.class
assert_equal InstanceVariable , lst.value.class
end

View File

@ -1,10 +1,11 @@
require_relative "../helper"
require_relative "helper"
module Vool
class TestLogical < MiniTest::Test
include RubyTests
def simple
RubyCompiler.compile( "@a and @b")
compile( "@a and @b")
end
def test_simple
lst = simple
@ -24,16 +25,16 @@ module Vool
end
def test_or
lst = RubyCompiler.compile( "@a or @b")
lst = compile( "@a or @b")
assert_equal :or , lst.name
end
def test_or2
lst = RubyCompiler.compile( "@a || @b")
lst = compile( "@a || @b")
assert_equal :or , lst.name
end
def test_and2
lst = RubyCompiler.compile( "@a && @b")
lst = compile( "@a && @b")
assert_equal :and , lst.name
end
end

View File

@ -2,10 +2,11 @@ require_relative "helper"
module Vool
class TestMethodStatement < MiniTest::Test
include RubyTests
def basic_setup()
input = "def tryout(arg1, arg2) ; true ; false ; end "
@lst = RubyCompiler.compile( input )
@lst = compile( input )
end
def test_method
basic_setup
@ -28,12 +29,12 @@ module Vool
end
def test_body_is_scope_one_statement
input = "def tryout(arg1, arg2) ; a = true ; end "
lst = RubyCompiler.compile( input )
lst = compile( input )
assert_equal LocalAssignment , lst.body.class
end
def test_body_is_scope_zero_statement
input = "def tryout(arg1, arg2) ; arg1 = arg2 ; end "
lst = RubyCompiler.compile( input )
lst = compile( input )
assert_equal LocalAssignment , lst.body.class
end
end

View File

@ -20,8 +20,9 @@ module Vool
end
class TestLocalOpAssign < MiniTest::Test
include OpAss
include RubyTests
def setup
@lst = RubyCompiler.compile( "foo += 5")
@lst = compile( "foo += 5")
end
def test_local_ass
assert_equal LocalAssignment , @lst.class
@ -29,8 +30,9 @@ module Vool
end
class TestIvarOpAssign < MiniTest::Test
include OpAss
include RubyTests
def setup
@lst = RubyCompiler.compile( "@foo += 5")
@lst = compile( "@foo += 5")
end
def test_ivar_ass
assert_equal IvarAssignment , @lst.class

View File

@ -2,19 +2,20 @@ require_relative "helper"
module Vool
class TestReturnStatement < MiniTest::Test
include RubyTests
def test_return_const
lst = RubyCompiler.compile( "return 1" )
lst = compile( "return 1" )
assert_equal ReturnStatement , lst.class
end
def test_return_value
lst = RubyCompiler.compile( "return 1" )
lst = compile( "return 1" )
assert_equal 1 , lst.return_value.value
end
def test_return_send
lst = RubyCompiler.compile( "return foo" )
lst = compile( "return foo" )
assert_equal SendStatement , lst.return_value.class
assert_equal :foo , lst.return_value.name
end

View File

@ -1,61 +1,62 @@
require_relative "../helper"
require_relative "helper"
module Vool
class TestSend < MiniTest::Test
include RubyTests
def test_simple
lst = RubyCompiler.compile( "foo")
lst = compile( "foo")
assert_equal SendStatement , lst.class
end
def test_simple_name
lst = RubyCompiler.compile( "foo")
lst = compile( "foo")
assert_equal :foo , lst.name
end
def test_simple_receiver
lst = RubyCompiler.compile( "foo")
lst = compile( "foo")
assert_equal SelfExpression , lst.receiver.class
end
def test_simple_args
lst = RubyCompiler.compile( "foo")
lst = compile( "foo")
assert_equal [] , lst.arguments
end
def test_one_arg
lst = RubyCompiler.compile( "bar(1)")
lst = compile( "bar(1)")
assert_equal SendStatement , lst.class
end
def test_one_arg_name
lst = RubyCompiler.compile( "bar(1)")
lst = compile( "bar(1)")
assert_equal :bar , lst.name
end
def test_one_arg_receiver
lst = RubyCompiler.compile( "bar(1)")
lst = compile( "bar(1)")
assert_equal SelfExpression , lst.receiver.class
end
def test_one_arg_args
lst = RubyCompiler.compile( "bar(1)")
lst = compile( "bar(1)")
assert_equal 1 , lst.arguments.first.value
end
def test_super0_receiver
lst = RubyCompiler.compile( "super")
lst = compile( "super")
assert_equal SuperExpression , lst.receiver.class
end
def test_super0
lst = RubyCompiler.compile( "super")
lst = compile( "super")
assert_equal SendStatement , lst.class
end
def test_super_receiver
lst = RubyCompiler.compile( "super(1)")
lst = compile( "super(1)")
assert_equal SuperExpression , lst.receiver.class
end
def test_super_args
lst = RubyCompiler.compile( "super(1)")
lst = compile( "super(1)")
assert_equal 1 , lst.arguments.first.value
end
def test_super_name #is nil
lst = RubyCompiler.compile( "super(1)")
lst = compile( "super(1)")
assert_nil lst.name
end
end
@ -66,12 +67,12 @@ module Vool
end
def test_int_receiver
sent = RubyCompiler.compile( "5.div4")
sent = compile( "5.div4")
assert_equal Parfait::Type , sent.receiver.ct_type.class
assert_equal "Integer_Type" , sent.receiver.ct_type.name
end
def test_string_receiver
sent = RubyCompiler.compile( "'5'.putstring")
sent = compile( "'5'.putstring")
assert_equal Parfait::Type , sent.receiver.ct_type.class
assert_equal "Word_Type" , sent.receiver.ct_type.name
end

View File

@ -2,56 +2,57 @@ require_relative "helper"
module Vool
class TestVariables < MiniTest::Test
include RubyTests
# "free standing" local can not be tested as it will result in send
# in other words ther is no way of knowing if a name is variable or method
# one needs an assignemnt first, to "tell" the parser it's a local
def test_local_basic
lst = RubyCompiler.compile( "foo = 1 ; foo")
lst = compile( "foo = 1 ; foo")
assert_equal ScopeStatement , lst.class
assert_equal LocalVariable , lst.statements[1].class
end
def test_local_nane
lst = RubyCompiler.compile( "foo = 1 ; foo")
lst = compile( "foo = 1 ; foo")
assert_equal LocalVariable , lst.statements[1].class
end
def test_instance_basic
lst = RubyCompiler.compile( "@var" )
lst = compile( "@var" )
assert_equal InstanceVariable , lst.class
assert_equal :var , lst.name
end
def test_instance_return
lst = RubyCompiler.compile( "return @var" )
lst = compile( "return @var" )
assert_equal InstanceVariable , lst.return_value.class
end
def test_class_basic
lst = RubyCompiler.compile( "@@var" )
lst = compile( "@@var" )
assert_equal ClassVariable , lst.class
assert_equal :var , lst.name
end
def test_class_return
lst = RubyCompiler.compile( "return @@var" )
lst = compile( "return @@var" )
assert_equal ClassVariable , lst.return_value.class
end
def test_module_basic
lst = RubyCompiler.compile( "Module" )
lst = compile( "Module" )
assert_equal ModuleName , lst.class
assert_equal :Module , lst.name
end
def test_module_base_scoped
lst = RubyCompiler.compile( "::Module" )
lst = compile( "::Module" )
assert_equal ModuleName , lst.class
assert_equal :Module , lst.name
end
def test_module_module_scoped
assert_raises {RubyCompiler.compile( "M::Module" ) }
assert_raises {compile( "M::Module" ) }
end
end
end

View File

@ -1,6 +1,6 @@
require_relative 'helper'
module Vool
module RubyX
class TestWhileStatement < MiniTest::Test
def basic_while

View File

@ -2,10 +2,11 @@ require_relative "helper"
module Vool
class TestYieldStatement < MiniTest::Test
include RubyTests
def setup()
input = "def plus_one; yield(0) ; end "
@lst = RubyCompiler.compile( input )
@lst = compile( input )
end
def test_method
assert_equal MethodStatement , @lst.class

View File

@ -1,6 +1,6 @@
require_relative "helper"
require_relative "../helper"
module Vool
module RubyX
class TestClassCompiler < MiniTest::Test
include CompilerHelper
@ -9,7 +9,7 @@ module Vool
end
def compile_in_test input
vool = VoolCompiler.ruby_to_vool in_Test(input)
vool = RubyXCompiler.ruby_to_vool in_Test(input)
vool.to_mom(nil)
itest = Parfait.object_space.get_class_by_name(:Test)
assert itest
@ -28,26 +28,33 @@ module Vool
def test_doesnt_create_existing_clas
space_class = Parfait.object_space.get_class_by_name(:Space)
VoolCompiler.ruby_to_vool "class Space ; end"
RubyXCompiler.ruby_to_vool "class Space ; end"
clazz = Parfait.object_space.get_class_by_name(:Space)
assert_equal clazz , space_class
end
def test_class_body_is_scope
clazz = VoolCompiler.ruby_to_vool in_Test("def meth; @ivar = 5 ;end")
clazz = RubyXCompiler.ruby_to_vool in_Test("def meth; @ivar = 5 ;end")
assert_equal MethodStatement , clazz.body.class
end
def test_creates_class_without_deriviation
vool = VoolCompiler.ruby_to_vool "class Testing ; end"
vool = RubyXCompiler.ruby_to_vool "class Testing ; end"
vool.to_mom(nil)
clazz = Parfait.object_space.get_class_by_name(:Testing)
assert clazz , "No classes created"
assert_equal :Object , clazz.super_class_name
end
def test_creates_class_deriviation
vool = RubyXCompiler.ruby_to_vool "class Testing ; end"
mom = vool.to_mom(nil)
assert_equal ClassStatement , vool.class
assert mom , "No classes created"
end
def test_creates_class_with_deriviation
vool = VoolCompiler.ruby_to_vool "class Test2 < List ;end"
vool = RubyXCompiler.ruby_to_vool "class Test2 < List ;end"
vool.to_mom(nil)
clazz = Parfait.object_space.get_class_by_name(:Test2)
assert clazz, "No classes created"
@ -56,14 +63,14 @@ module Vool
def test_space_is_unchanged_by_compile
space1 = Parfait.object_space.get_class_by_name(:Space)
VoolCompiler.ruby_to_vool "class Space ;end"
RubyXCompiler.ruby_to_vool "class Space ;end"
space2 = Parfait.object_space.get_class_by_name(:Space)
assert_equal space1 , space2
end
def test_space_type_is_unchanged_by_compile
space1 = Parfait.object_space.get_class_by_name(:Space).instance_type
VoolCompiler.ruby_to_vool "class Space ;end"
RubyXCompiler.ruby_to_vool "class Space ;end"
space2 = Parfait.object_space.get_class_by_name(:Space).instance_type
assert_equal space1 , space2
end

View File

@ -8,7 +8,7 @@ module Risc
def setup
Risc.machine.boot
Vool::VoolCompiler.ruby_to_binary( @string_input , :interpreter)
Vool::RubyXCompiler.ruby_to_binary( @string_input , :interpreter)
@interpreter = Interpreter.new
@interpreter.start_machine
end

View File

@ -1 +0,0 @@
require_relative "../helper"