rubyx/lib/vool/local_assignment.rb
Torsten Ruger 3f80953385 passing compiler to to_mom, not method
To be able to delegate scope (block/method) things later
2018-07-05 14:02:38 +03:00

18 lines
402 B
Ruby

module Vool
class LocalAssignment < Assignment
def to_mom( compiler )
if compiler.method.arguments_type.variable_index(@name)
type = :arguments
else
type = :frame
end
to = Mom::SlotDefinition.new(:message ,[ type , @name])
from = @value.slot_definition(compiler)
return chain_assign( Mom::SlotLoad.new(to,from) , compiler)
end
end
end