the further down this goes, the smaller the circles. Soon the point will come. And then back out

This commit is contained in:
Torsten Ruger
2014-06-03 14:49:02 +03:00
parent f60bbfa9ca
commit b7c2089046
7 changed files with 90 additions and 56 deletions

View File

@ -31,10 +31,16 @@ module Ast
locals[arg] = arg_value
args << arg_value
end
class_name = context.current_class.name
function = Vm::Function.new(name , args )
# class depends on receiver
context.current_class.add_function function
if receiver.nil?
clazz = context.current_class
else
c = context.object_space.get_or_create_class receiver.name.to_sym
clazz = c.meta_class
end
function = Vm::Function.new(name , args )
clazz.add_function function
parent_locals = context.locals
parent_function = context.function