make method creation class methods in MethodCompiler

and pass the wish to use main explicitly, which is really a test
feature
This commit is contained in:
Torsten Ruger
2017-01-17 21:23:58 +02:00
parent 0c64e367d5
commit cd211f970f
8 changed files with 21 additions and 22 deletions

View File

@ -22,7 +22,7 @@ require 'rubyx'
module Compiling
def clean_compile(clazz_name , method_name , args , statements)
compiler = Vm::MethodCompiler.new.create_method(clazz_name,method_name,args ).init_method
compiler = Vm::MethodCompiler.create_method(clazz_name,method_name,args ).init_method
compiler.process( Vm.ast_to_code( statements ) )
end

View File

@ -28,7 +28,7 @@ module Register
include AST::Sexp
include Compiling
include SpaceHack
def setup
Register.machine.boot # force boot to reset main
end
@ -41,7 +41,7 @@ module Register
end
def check_nil
assert @expect , "No output given"
compiler = Vm::MethodCompiler.new
compiler = Vm::MethodCompiler.new(:main)
code = Vm.ast_to_code( @input )
assert code.to_s , @input
produced = compiler.process( code )