fix a whole bunch of vool to_mom
All but those requiring boot functions
This commit is contained in:
@ -21,6 +21,11 @@ module VoolCompile
|
||||
include ScopeHelper
|
||||
include Mom
|
||||
|
||||
def compile_vool_method(input)
|
||||
statements = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_vool(as_main(input))
|
||||
assert statements.is_a?(Vool::Statement) , statements.class
|
||||
statements
|
||||
end
|
||||
def compile_method(input)
|
||||
collection = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom(input)
|
||||
assert collection.is_a?(Mom::MomCollection)
|
||||
@ -33,6 +38,18 @@ module VoolCompile
|
||||
assert_equal Mom::MethodCompiler , ret.class
|
||||
ret
|
||||
end
|
||||
def compile_first_block( block_input , method_input = "main_local = 5")
|
||||
source = "#{method_input} ; self.main{|val| #{block_input}}"
|
||||
vool = Ruby::RubyCompiler.compile( as_test_main(source) ).to_vool
|
||||
mom_c = vool.to_mom(nil)
|
||||
compiler = mom_c.method_compilers.find{|c| c.get_method.name == :main and c.get_method.self_type.object_class.name == :Test}
|
||||
block = nil
|
||||
vool.each {|b| block = b if b.is_a?(Vool::BlockStatement)}
|
||||
assert block
|
||||
block_c = compiler.block_compilers.first
|
||||
assert block_c
|
||||
block.body.to_mom(block_c)
|
||||
end
|
||||
def check_array( should , is )
|
||||
index = 0
|
||||
test = is
|
||||
|
Reference in New Issue
Block a user