start with block_compiler

as a copy of method_compiler
re-merge later, when we know what's needed
This commit is contained in:
Torsten Ruger
2018-07-09 16:48:23 +03:00
parent 7231f301ba
commit dd544214b3
10 changed files with 159 additions and 13 deletions

View File

@ -37,7 +37,10 @@ module MomCompile
assert_equal Risc::MethodCompiler , compiler.class
@method.source.to_mom( compiler )
end
def compile_first_block( block_input )
mom = compile_first_method( "main_local = 5 ; self.main{|val| #{block_input}}")
mom.next(4) # ignore local assign (1) and call (3)
end
def compile_mom(input)
Risc.boot!
RubyX::RubyXCompiler.new(input).ruby_to_mom