use rubyc_compiler as instance
not as before class methods so we can carry the state around
This commit is contained in:
@ -8,13 +8,14 @@ module RubyX
|
||||
end
|
||||
def ruby_to_risc(input , platform)
|
||||
mom = ruby_to_mom(input)
|
||||
puts "MOM #{mom.class}"
|
||||
mom.translate(platform)
|
||||
end
|
||||
def ruby_to_vool(input)
|
||||
RubyXCompiler.ruby_to_vool(input)
|
||||
RubyXCompiler.new(input).ruby_to_vool
|
||||
end
|
||||
def ruby_to_mom(input)
|
||||
RubyXCompiler.ruby_to_mom(input)
|
||||
RubyXCompiler.new(input).ruby_to_mom
|
||||
end
|
||||
def compile_in_test input
|
||||
vool = ruby_to_vool in_Test(input)
|
||||
|
@ -22,7 +22,7 @@ module MomCompile
|
||||
include ScopeHelper
|
||||
|
||||
def compile_mom(input)
|
||||
statements = RubyX::RubyXCompiler.ruby_to_vool input
|
||||
statements = RubyX::RubyXCompiler.new(input).ruby_to_vool
|
||||
res = statements.to_mom(nil)
|
||||
assert_equal Parfait::Class , statements.clazz.class , statements
|
||||
@method = statements.clazz.get_method(:main)
|
||||
@ -31,7 +31,12 @@ module MomCompile
|
||||
end
|
||||
def compile_first_method( input )
|
||||
res = compile_mom( as_test_main( input ))
|
||||
res.clazz.instance_methods.first.compile_to_mom(res.clazz.instance_type)
|
||||
method = res.clazz.instance_methods.first
|
||||
compile_to_mom(method , res.clazz.instance_type)
|
||||
end
|
||||
def compile_to_mom(method , for_type)
|
||||
typed_method = create_typed_method(for_type)
|
||||
source.to_mom( typed_method )
|
||||
end
|
||||
|
||||
def check_array( should , is )
|
||||
|
Reference in New Issue
Block a user