rubyx/lib/vool/statements/local_assignment.rb
Torsten Ruger 79bf416e58 collapsed slot classes into one
different slot operation have different right sides
mom assignment tests work again
157 others don’t
2018-03-15 20:33:38 +05:30

23 lines
470 B
Ruby

module Vool
class LocalAssignment < Assignment
def normalize
super
return LocalAssignment.new(@name , @value)
end
def to_mom( method )
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