moving vool_method to parfait
This commit is contained in:
@ -31,9 +31,16 @@ module Vool
|
||||
def create_objects
|
||||
args_type = make_type
|
||||
locals_type = make_locals
|
||||
method = Vool::VoolMethod.new(name , args_type , locals_type , body )
|
||||
method = Parfait::VoolMethod.new(name , args_type , locals_type , body )
|
||||
@clazz.add_method( method )
|
||||
# compile_methods(clazz,methods)
|
||||
end
|
||||
|
||||
def compile_methods(clazz , methods)
|
||||
methods.each do |method|
|
||||
code = Passes::MethodCompiler.new(method).get_code
|
||||
typed_method = method.create_parfait_method(clazz.instance_type)
|
||||
Vm::MethodCompiler.new( typed_method ).init_method.process( code )
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
@ -52,23 +59,5 @@ module Vool
|
||||
Parfait::NamedList.type_for( type_hash )
|
||||
end
|
||||
|
||||
def create_methods(clazz , body)
|
||||
methods = Passes::MethodCollector.new.collect(body)
|
||||
methods.each do |method|
|
||||
clazz.add_method( method )
|
||||
normalizer = Passes::Normalizer.new(method)
|
||||
method.normalize_source { |sourc| normalizer.process( sourc ) }
|
||||
end
|
||||
methods
|
||||
end
|
||||
|
||||
def compile_methods(clazz , methods)
|
||||
methods.each do |method|
|
||||
code = Passes::MethodCompiler.new(method).get_code
|
||||
typed_method = method.create_parfait_method(clazz.instance_type)
|
||||
Vm::MethodCompiler.new( typed_method ).init_method.process( code )
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user