rubyx/lib/vool/statements/local_assignment.rb
Torsten Ruger ea882f403a pass parfait method to to_mom
previously it was the toll incarnation, and that is almost the same
But for the type of self. This s by definition only known in the
parfait method
And we need it off course for type checking/dispatch
2018-03-16 11:03:29 +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.arguments.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