be10e8c6af
for statement tests and write mom tests also implement to_mom and fix local (self) bug
26 lines
467 B
Ruby
26 lines
467 B
Ruby
module Vool
|
|
|
|
class Assignment < Statement
|
|
attr_reader :name , :value
|
|
def initialize(name , value )
|
|
@name , @value = name , value
|
|
end
|
|
def collect(arr)
|
|
@value.collect(arr)
|
|
super
|
|
end
|
|
end
|
|
|
|
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
|