minor cleaning

This commit is contained in:
Torsten Ruger 2015-11-07 21:55:04 +02:00
parent 8c68ffc7a4
commit 2315ad6920
5 changed files with 3 additions and 10 deletions

View File

@ -115,7 +115,6 @@ module Interpreter
end
def execute_GetSlot
puts @instruction
object = get_register( @instruction.array )
if( @instruction.index.is_a?(Numeric) )
index = @instruction.index

View File

@ -63,7 +63,6 @@ module Parfait
end
def super_class
puts "Superclass #{super_class_name}"
Parfait::Space.object_space.get_class_by_name(self.super_class_name)
end

View File

@ -44,6 +44,7 @@ module Register
#helper method to calculate with register symbols
def next_reg_use type , value = nil
int = @symbol[1,3].to_i
raise "No more registers #{self}" if int > 12
sym = "r#{int + 1}".to_sym
RegisterValue.new( sym , type, value)
end
@ -111,10 +112,4 @@ module Register
return register
end
# when knowing the index of the argument, return the index into the message
# index passed is parfait, ie stats at 1
def self.arg_index i
last = resolve_index :message , :name
return last + i
end
end

View File

@ -26,8 +26,8 @@ module Soml
set_message_details(name_s , arguments)
set_arguments(arguments)
ret = use_reg( :Integer ) #TODO real return type
do_call(clazz , statement)
ret = use_reg( :Integer )
# the effect of the method is that the NewMessage Return slot will be filled, return it
# but move it into a register too
add_code Register.get_slot(statement, :new_message , :return_value , ret )

View File

@ -2,7 +2,7 @@ module Soml
Compiler.class_eval do
def on_return statement
reg = process(statement.first )
reg = process(statement.first)
add_code Register.set_slot( statement, reg , :message , :return_value)
nil # statements don't return
end