2017-04-12 19:18:41 +02:00
|
|
|
module Vool
|
|
|
|
|
|
|
|
class LocalAssignment < Assignment
|
2018-03-15 16:03:38 +01:00
|
|
|
|
|
|
|
def normalize
|
|
|
|
super
|
|
|
|
return LocalAssignment.new(@name , @value)
|
2017-04-12 19:18:41 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def to_mom( method )
|
2018-03-16 06:33:29 +01:00
|
|
|
if method.arguments.variable_index(@name)
|
2017-04-13 13:14:43 +02:00
|
|
|
type = :arguments
|
|
|
|
else
|
|
|
|
type = :frame
|
|
|
|
end
|
2018-03-15 16:03:38 +01:00
|
|
|
to = Mom::SlotDefinition.new(:message ,[ type , @name])
|
|
|
|
from = @value.slot_definition(method)
|
|
|
|
return chain_assign( Mom::SlotLoad.new(to,from) , method)
|
2017-04-12 19:18:41 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|