some renames before main fixes commences
This commit is contained in:
@ -1,10 +1,6 @@
|
||||
|
||||
module ScopeHelper
|
||||
|
||||
def in_Test(statements)
|
||||
"class Test ; #{statements} ; end"
|
||||
end
|
||||
|
||||
def in_Space(statements)
|
||||
"class Space ; #{statements} ; end"
|
||||
end
|
||||
@ -13,12 +9,8 @@ module ScopeHelper
|
||||
in_Space("def main(arg) ; #{statements}; end")
|
||||
end
|
||||
|
||||
def as_test_main( statements )
|
||||
in_Test("def main(arg) ; #{statements}; end")
|
||||
end
|
||||
|
||||
def as_test_main_block( block_input = "return 5", method_input = "main_local = 5")
|
||||
as_test_main("#{method_input} ; self.main{|val| #{block_input}}")
|
||||
def as_main_block( block_input = "return 5", method_input = "main_local = 5")
|
||||
as_main("#{method_input} ; self.main{|val| #{block_input}}")
|
||||
end
|
||||
|
||||
end
|
||||
@ -26,8 +18,8 @@ module VoolCompile
|
||||
include ScopeHelper
|
||||
include Mom
|
||||
|
||||
def compile_first_method( input )
|
||||
input = as_test_main( input )
|
||||
def compile_main( input )
|
||||
input = as_main( input )
|
||||
collection = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom(input)
|
||||
assert collection.is_a?(Mom::MomCollection) , collection.class.name
|
||||
compiler = collection.compilers.first
|
||||
@ -35,8 +27,8 @@ module VoolCompile
|
||||
assert_equal Mom::MethodCompiler , compiler.class
|
||||
compiler
|
||||
end
|
||||
def compile_first_block( block_input , method_input = "main_local = 5")
|
||||
source = as_test_main("#{method_input} ; self.main{|val| #{block_input}}")
|
||||
def compile_main_block( block_input , method_input = "main_local = 5")
|
||||
source = as_main("#{method_input} ; self.main{|val| #{block_input}}")
|
||||
mom_col = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom( source )
|
||||
compiler = mom_col.method_compilers.find{|c| c.get_method.name.to_s.start_with?("main") }
|
||||
block = compiler.block_compilers.first
|
||||
|
Reference in New Issue
Block a user