implements self sent

with explicit and implicit self
This commit is contained in:
Torsten Ruger
2017-04-25 09:40:09 +03:00
parent 47683817ee
commit bbc13946ed
3 changed files with 61 additions and 1 deletions

View File

@ -33,6 +33,14 @@ module Vool
end
end
class SelfStatement < Statement
attr_reader :clazz
def set_class(clazz)
@clazz = clazz
end
def ct_type
@clazz.instance_type
end
end
class SuperStatement < Statement
end

View File

@ -56,7 +56,8 @@ module Vool
def simple_call
type = @receiver.ct_type
method = type.get_method(@name)
method = type.resolve_method(@name)
raise "No method #{@name} for #{type}" unless method
[Mom::SimpleCall.new( method) ]
end