rubyx/lib/vool/local_assignment.rb
Torsten Ruger f4402ba30f fix local assignment
was missing a method that got lost in copy/paste
also renaming to get guard to pick up tests
2018-07-20 14:16:29 +03:00

19 lines
455 B
Ruby

module Vool
class LocalAssignment < Assignment
def to_mom( compiler )
slot_def = compiler.slot_type_for(@name)
to = Mom::SlotDefinition.new(:message ,slot_def)
from = @value.slot_definition(compiler)
return chain_assign( Mom::SlotLoad.new(to,from) , compiler)
end
def chain_assign(assign , compiler)
return assign unless @value.is_a?(SendStatement)
@value.to_mom(compiler) << assign
end
end
end