vool working after message change

This commit is contained in:
2019-08-22 21:24:02 +03:00
parent 0a1b05b2ee
commit 0c49612e5e
10 changed files with 45 additions and 16 deletions

View File

@ -10,7 +10,9 @@ module Vool
# Only snag is that we do not know this position, as only the compiler knows
# if the variable name is a local or an arg. So we delegate to the compiler.
def slot_position( compiler )
compiler.slot_type_for(@name)
slot = compiler.slot_type_for(@name)
#puts "SLOT= #{slot}"
slot
end
end

View File

@ -46,10 +46,10 @@ module Vool
def message_setup(compiler,called_method)
setup = Mom::MessageSetup.new( called_method )
mom_receive = @receiver.to_slot(compiler)
arg_target = [:message , :next_message , :arguments]
arg_target = [:message , :next_message ]
args = []
@arguments.each_with_index do |arg , index| # +1 because of type
args << Mom::SlotLoad.new(self, arg_target + [index + 1] , arg.to_slot(compiler))
args << Mom::SlotLoad.new(self, arg_target + ["arg#{index+1}".to_sym] , arg.to_slot(compiler))
end
setup << Mom::ArgumentTransfer.new(self, mom_receive , args )
end

View File

@ -50,10 +50,10 @@ module Vool
arg_index = compiler.get_method.arguments_type.get_length - 1
setup = Mom::MessageSetup.new( arg_index )
mom_receive = @receiver.to_slot(compiler)
arg_target = [:message , :next_message , :arguments]
arg_target = [:message , :next_message ]
args = []
@arguments.each_with_index do |arg , index| # +1 because of type
args << Mom::SlotLoad.new(self, arg_target + [index + 1] , arg.to_slot(compiler))
args << Mom::SlotLoad.new(self, arg_target + ["arg#{index+1}".to_sym] , arg.to_slot(compiler))
end
setup << Mom::ArgumentTransfer.new( self , mom_receive , args )
setup << Mom::BlockYield.new( self , arg_index )