rubyx/lib/vool/statements/variables.rb
Torsten Ruger ee0a1ca823 renaming methods args and frame
to arguments_type and frame_type, because that is what they are
In honour of setup bug, where the types of those types were loaded,
instead of just them types
2018-04-05 12:22:14 +03:00

42 lines
796 B
Ruby

module Vool
module Named
attr_reader :name
def initialize name
@name = name
end
def each(&block)
end
end
class LocalVariable < Expression
include Named
def slot_definition(method)
if method.arguments_type.variable_index(@name)
type = :arguments
else
type = :frame
end
Mom::SlotDefinition.new(:message , [type , @name])
end
end
class InstanceVariable < Expression
include Named
def slot_definition(method)
Mom::SlotDefinition.new(:message , [ :receiver , @name] )
end
# used to collect type information
def add_ivar( array )
array << @name
end
end
class ClassVariable < Expression
include Named
end
class ModuleName < Expression
include Named
end
end