minor cleaning
This commit is contained in:
parent
8c68ffc7a4
commit
2315ad6920
@ -115,7 +115,6 @@ module Interpreter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def execute_GetSlot
|
def execute_GetSlot
|
||||||
puts @instruction
|
|
||||||
object = get_register( @instruction.array )
|
object = get_register( @instruction.array )
|
||||||
if( @instruction.index.is_a?(Numeric) )
|
if( @instruction.index.is_a?(Numeric) )
|
||||||
index = @instruction.index
|
index = @instruction.index
|
||||||
|
@ -63,7 +63,6 @@ module Parfait
|
|||||||
end
|
end
|
||||||
|
|
||||||
def super_class
|
def super_class
|
||||||
puts "Superclass #{super_class_name}"
|
|
||||||
Parfait::Space.object_space.get_class_by_name(self.super_class_name)
|
Parfait::Space.object_space.get_class_by_name(self.super_class_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ module Register
|
|||||||
#helper method to calculate with register symbols
|
#helper method to calculate with register symbols
|
||||||
def next_reg_use type , value = nil
|
def next_reg_use type , value = nil
|
||||||
int = @symbol[1,3].to_i
|
int = @symbol[1,3].to_i
|
||||||
|
raise "No more registers #{self}" if int > 12
|
||||||
sym = "r#{int + 1}".to_sym
|
sym = "r#{int + 1}".to_sym
|
||||||
RegisterValue.new( sym , type, value)
|
RegisterValue.new( sym , type, value)
|
||||||
end
|
end
|
||||||
@ -111,10 +112,4 @@ module Register
|
|||||||
return register
|
return register
|
||||||
end
|
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
|
end
|
||||||
|
@ -26,8 +26,8 @@ module Soml
|
|||||||
|
|
||||||
set_message_details(name_s , arguments)
|
set_message_details(name_s , arguments)
|
||||||
set_arguments(arguments)
|
set_arguments(arguments)
|
||||||
|
ret = use_reg( :Integer ) #TODO real return type
|
||||||
do_call(clazz , statement)
|
do_call(clazz , statement)
|
||||||
ret = use_reg( :Integer )
|
|
||||||
# the effect of the method is that the NewMessage Return slot will be filled, return it
|
# the effect of the method is that the NewMessage Return slot will be filled, return it
|
||||||
# but move it into a register too
|
# but move it into a register too
|
||||||
add_code Register.get_slot(statement, :new_message , :return_value , ret )
|
add_code Register.get_slot(statement, :new_message , :return_value , ret )
|
||||||
|
@ -2,7 +2,7 @@ module Soml
|
|||||||
Compiler.class_eval do
|
Compiler.class_eval do
|
||||||
|
|
||||||
def on_return statement
|
def on_return statement
|
||||||
reg = process(statement.first )
|
reg = process(statement.first)
|
||||||
add_code Register.set_slot( statement, reg , :message , :return_value)
|
add_code Register.set_slot( statement, reg , :message , :return_value)
|
||||||
nil # statements don't return
|
nil # statements don't return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user