extracting methods for the compiler to handle
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
require_relative "type_collector"
|
||||
require_relative "compiler/type_collector"
|
||||
require_relative "compiler/method_collector"
|
||||
require_relative "compiler/ruby_method"
|
||||
|
||||
|
||||
module Melon
|
||||
@@ -19,7 +21,17 @@ module Melon
|
||||
name , sup , body = *statement
|
||||
clazz = Parfait::Space.object_space.create_class(get_name(name) , get_name(sup) )
|
||||
ivar_hash = TypeCollector.new.collect(body)
|
||||
clazz.set_instance_type( Parfait::Type.for_hash( clazz , ivar_hash ) )
|
||||
clazz.set_instance_type( Parfait::Type.for_hash( clazz , ivar_hash ) )
|
||||
|
||||
MethodCollector.new.collect(body)
|
||||
|
||||
end
|
||||
|
||||
def handler_missing(node)
|
||||
node.children.each do |kid |
|
||||
process(kid) if kid.is_a?(AST::Node)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user