Make to_mom a 2 stage process

First baby baby step on the way to passes
Create all parfait objects in first pass, so methods exist to be resolved in second path
This commit is contained in:
2019-09-24 15:44:33 +03:00
parent 3510637d21
commit dd810cfc49
15 changed files with 159 additions and 85 deletions

View File

@ -7,10 +7,19 @@ module Vool
raise "no bod" unless @body
end
# create the parfait VoolMethod to hold the code for this method
#
# Must pass in the actual Parfait class (default nil is just to conform to api)
def to_parfait( clazz = nil )
raise "No class given to class method #{name}" unless clazz
clazz.add_instance_method_for(name , make_arg_type , make_frame , body )
end
def to_mom(clazz)
raise "not singleton" unless clazz.class == Parfait::SingletonClass
raise( "no class in #{self}") unless clazz
method = clazz.add_instance_method_for(name , make_arg_type , make_frame , body )
method = clazz.get_instance_method(name )
raise( "no class method in #{@name} in #{clazz}") unless method
#puts "CLass method Class:#{clazz}:#{name}"
compiler = method.compiler_for(clazz.instance_type)
each {|node| raise "Blocks not implemented" if node.is_a?(LambdaExpression)}