2017-04-01 20:28:57 +02:00
|
|
|
module Vool
|
2017-04-12 19:29:45 +02:00
|
|
|
|
2017-04-01 20:28:57 +02:00
|
|
|
class Assignment < Statement
|
2017-04-06 15:06:51 +02:00
|
|
|
attr_reader :name , :value
|
2017-04-02 11:59:07 +02:00
|
|
|
def initialize(name , value )
|
|
|
|
@name , @value = name , value
|
2017-04-01 20:28:57 +02:00
|
|
|
end
|
2017-04-08 11:10:42 +02:00
|
|
|
def collect(arr)
|
|
|
|
@value.collect(arr)
|
|
|
|
super
|
|
|
|
end
|
2017-04-01 20:28:57 +02:00
|
|
|
end
|
2017-04-12 13:45:02 +02:00
|
|
|
|
2017-04-12 19:29:45 +02:00
|
|
|
class IvarAssignment < Assignment
|
2017-04-08 11:18:10 +02:00
|
|
|
# used to collect type information
|
|
|
|
def add_ivar( array )
|
|
|
|
array << @name
|
|
|
|
end
|
2017-04-12 19:29:45 +02:00
|
|
|
|
|
|
|
def to_mom( method )
|
2017-09-10 12:33:32 +02:00
|
|
|
@value.slot_class.new([:message , :self , @name] , @value)
|
2017-04-12 19:29:45 +02:00
|
|
|
end
|
|
|
|
|
2017-04-04 17:10:28 +02:00
|
|
|
end
|
2017-04-01 20:28:57 +02:00
|
|
|
end
|