rubyx/lib/vool/statements/local_assignment.rb

23 lines
470 B
Ruby
Raw Normal View History

module Vool
class LocalAssignment < Assignment
def normalize
super
return LocalAssignment.new(@name , @value)
end
def to_mom( method )
2017-04-13 13:14:43 +02:00
if method.args_type.variable_index(@name)
type = :arguments
else
type = :frame
end
to = Mom::SlotDefinition.new(:message ,[ type , @name])
from = @value.slot_definition(method)
return chain_assign( Mom::SlotLoad.new(to,from) , method)
end
end
end