rubyx/lib/vool/statements/assignment_statement.rb
Torsten Ruger b0e3978b15 starts on local variable collection
500 tests (in under 2 seconds), yippie
2017-04-08 12:28:31 +03:00

25 lines
508 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 LocalAssignment < Assignment
# used to collect frame information
def add_local( array )
array << @name
end
end
class InstanceAssignment < Assignment
# used to collect type information
def add_ivar( array )
array << @name
end
end
end