return compiler, not generated mom

does make the tests more verbose, but the code cleaner
This commit is contained in:
Torsten Ruger 2018-07-01 11:57:17 +03:00
parent f7dfa1c45e
commit 1a97408e22
3 changed files with 4 additions and 9 deletions

View File

@ -28,17 +28,12 @@ module Parfait
type.create_method( @name , @args_type , @frame_type)
end
def compile_to_mom(for_type)
typed_method = create_typed_method(for_type)
source.to_mom( typed_method )
end
def compile_to_risc(for_type)
def compiler_for(for_type)
typed_method = create_typed_method(for_type)
head = source.to_mom( typed_method )
compiler = Risc::MethodCompiler.new( typed_method )
compiler.add_mom(head)
head # return for testing
compiler
end
end
end

View File

@ -23,7 +23,7 @@ module Risc
when "Interpreter"
return Risc::InterpreterPlatform.new
else
raise "not recignized platform #{name}"
raise "not recognized platform #{name.class}:#{name}"
end
end
end

View File

@ -11,7 +11,7 @@ module Vool
def to_mom(clazz)
@clazz = clazz || raise( "no class in #{self}")
method = @clazz.add_method_for(name , make_arg_type , make_frame , body )
method.compile_to_risc(clazz.instance_type)
method.compiler_for(clazz.instance_type)
end
def each(&block)