rename one ruby compiler to differentiate
This commit is contained in:
parent
be52403a1a
commit
d5a63ec431
@ -10,7 +10,7 @@ require_relative "ruby_method"
|
||||
|
||||
|
||||
module Rubyx
|
||||
class RubyCompiler < Passes::TotalProcessor
|
||||
class RubyxCompiler < Passes::TotalProcessor
|
||||
|
||||
def self.compile( input )
|
||||
ast = Parser::Ruby22.parse( input )
|
||||
|
@ -10,7 +10,7 @@ module Rubyx
|
||||
@string_input = as_main '"Hello there".putstring'
|
||||
Risc.machine.boot
|
||||
# do_clean_compile
|
||||
RubyCompiler.compile @string_input
|
||||
RubyxCompiler.compile @string_input
|
||||
Risc::Collector.collect_space
|
||||
@interpreter = Risc::Interpreter.new
|
||||
@interpreter.start Risc.machine.init
|
||||
|
@ -29,7 +29,7 @@ module Rubyx
|
||||
end
|
||||
|
||||
def test_compile_class
|
||||
RubyCompiler.compile "class TestIvar < Object ; def meth; @ivar;end; end"
|
||||
RubyxCompiler.compile "class TestIvar < Object ; def meth; @ivar;end; end"
|
||||
itest = Parfait.object_space.get_class_by_name(:TestIvar)
|
||||
assert itest
|
||||
assert itest.instance_type.names.include?(:ivar) , itest.instance_type.names.inspect
|
||||
|
@ -9,20 +9,20 @@ module Rubyx
|
||||
|
||||
def test_doesnt_create_existing_clas
|
||||
space_class = Parfait.object_space.get_class_by_name(:Space)
|
||||
RubyCompiler.compile "class Space ; end"
|
||||
RubyxCompiler.compile "class Space ; end"
|
||||
clazz = Parfait.object_space.get_class_by_name(:Space)
|
||||
assert_equal clazz , space_class
|
||||
end
|
||||
|
||||
def test_creates_class_without_deriviation
|
||||
RubyCompiler.compile "class Testing ; end"
|
||||
RubyxCompiler.compile "class Testing ; end"
|
||||
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_with_deriviation
|
||||
RubyCompiler.compile "class Test2 < List ;end"
|
||||
RubyxCompiler.compile "class Test2 < List ;end"
|
||||
clazz = Parfait.object_space.get_class_by_name(:Test2)
|
||||
assert clazz, "No classes created"
|
||||
assert_equal :List , clazz.super_class_name
|
||||
@ -30,14 +30,14 @@ module Rubyx
|
||||
|
||||
def test_space_is_unchanged_by_compile
|
||||
space1 = Parfait.object_space.get_class_by_name(:Space)
|
||||
RubyCompiler.compile "class Space ;end"
|
||||
RubyxCompiler.compile "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
|
||||
RubyCompiler.compile "class Space ;end"
|
||||
RubyxCompiler.compile "class Space ;end"
|
||||
space2 = Parfait.object_space.get_class_by_name(:Space).instance_type
|
||||
assert_equal space1 , space2
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user