set up ivar_assignment correctly

for statement tests
and write mom tests
also implement to_mom
and fix local (self) bug
This commit is contained in:
Torsten Ruger
2017-04-12 20:29:45 +03:00
parent 87133722b3
commit be10e8c6af
10 changed files with 62 additions and 17 deletions

View File

@ -1,4 +1,5 @@
module Vool
class Assignment < Statement
attr_reader :name , :value
def initialize(name , value )
@ -10,10 +11,15 @@ module Vool
end
end
class InstanceAssignment < Assignment
class IvarAssignment < Assignment
# used to collect type information
def add_ivar( array )
array << @name
end
def to_mom( method )
Mom::SlotConstant.new([:message , :self , @name] , @value)
end
end
end

View File

@ -7,7 +7,7 @@ module Vool
end
def to_mom( method )
Mom::SlotConstant.new([:message , :self , @name] , @value)
Mom::SlotConstant.new([:message , :frame , @name] , @value)
end
end