start to move translate code
This commit is contained in:
@ -6,6 +6,10 @@ module RubyX
|
||||
Parfait.boot!
|
||||
Risc.machine.boot
|
||||
end
|
||||
def ruby_to_risc(input , platform)
|
||||
mom = ruby_to_mom(input)
|
||||
mom.translate(platform)
|
||||
end
|
||||
def ruby_to_vool(input)
|
||||
RubyXCompiler.ruby_to_vool(input)
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
require_relative "helper"
|
||||
|
||||
module RubyX
|
||||
class TestVoolCompiler < MiniTest::Test
|
||||
class TestRubyXCompiler < MiniTest::Test
|
||||
include ScopeHelper
|
||||
include RubyXHelper
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
require_relative "helper"
|
||||
|
||||
module RubyX
|
||||
class TestVoolCompiler < MiniTest::Test
|
||||
class TestRubyXCompilerMom < MiniTest::Test
|
||||
include ScopeHelper
|
||||
include RubyXHelper
|
||||
|
||||
@ -14,7 +14,7 @@ module RubyX
|
||||
|
||||
def test_creates_class_deriviation
|
||||
mom = ruby_to_mom "class Testing ; end"
|
||||
#assert mom , "No classes created"
|
||||
#assert mom , "No classes created"
|
||||
end
|
||||
|
||||
def test_creates_class_with_deriviation
|
||||
|
15
test/rubyx/test_rubyx_compiler2.rb
Normal file
15
test/rubyx/test_rubyx_compiler2.rb
Normal file
@ -0,0 +1,15 @@
|
||||
require_relative "helper"
|
||||
|
||||
module RubyX
|
||||
class TestRubyXCompilerRisc < MiniTest::Test
|
||||
include ScopeHelper
|
||||
include RubyXHelper
|
||||
|
||||
def test_to_risc
|
||||
code = "class Space ; def main(arg);return arg;end; end"
|
||||
risc = ruby_to_risc(code, :interpreter)
|
||||
assert_equal Array , risc.class
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user