Move booting to RubyXCompiler init
Also pass the source into the compile method. This way compiler can be reused for subsequent compile. Does remove some double boots, but no major time save
This commit is contained in:
@ -22,7 +22,7 @@ module MomCompile
|
||||
include ScopeHelper
|
||||
|
||||
def compile_method(input)
|
||||
statements = RubyX::RubyXCompiler.new(input).ruby_to_vool
|
||||
statements = RubyX::RubyXCompiler.new.ruby_to_vool(input)
|
||||
assert statements.is_a?(Vool::ClassStatement)
|
||||
ret = statements.to_mom(nil)
|
||||
assert_equal Parfait::Class , statements.clazz.class , statements
|
||||
@ -50,8 +50,7 @@ module MomCompile
|
||||
block.body.to_mom(block_c)
|
||||
end
|
||||
def compile_mom(input)
|
||||
Risc.boot!
|
||||
RubyX::RubyXCompiler.new(input).ruby_to_mom
|
||||
RubyX::RubyXCompiler.new.ruby_to_mom(input)
|
||||
end
|
||||
|
||||
def check_array( should , is )
|
||||
|
@ -7,7 +7,7 @@ module Risc
|
||||
include ScopeHelper
|
||||
|
||||
def setup
|
||||
@linker = RubyX::RubyXCompiler.new(@string_input).ruby_to_binary( :interpreter)
|
||||
@linker = RubyX::RubyXCompiler.new.ruby_to_binary(@string_input, :interpreter)
|
||||
@interpreter = Interpreter.new(@linker)
|
||||
@interpreter.start_program
|
||||
end
|
||||
|
Reference in New Issue
Block a user