small rename to align has_locals and has_arguments

for semantic and code unification
This commit is contained in:
Torsten Ruger
2017-01-15 12:59:03 +02:00
parent 4095bb397f
commit a0cf5bffc0
3 changed files with 16 additions and 16 deletions

View File

@ -10,7 +10,7 @@ module Vm
[:self , :space , :message].each do |special|
return send(:"load_special_#{special}" , statement ) if name == special
end
return load_argument(statement) if( @method.has_arg(name))
return load_argument(statement) if( @method.has_argument(name))
load_local(statement)
end
@ -18,9 +18,9 @@ module Vm
def load_argument(statement)
name = statement.name
index = @method.has_arg(name)
index = @method.has_argument(name)
named_list = use_reg :NamedList
ret = use_reg @method.argument_type(index)
ret = use_reg @method.arguments_type(index)
#puts "For #{name} at #{index} got #{@method.arguments.inspect}"
add_slot_to_reg("#{statement} load args" , :message , :arguments, named_list )
add_slot_to_reg("#{statement} load #{name}" , named_list , index + 1, ret )

View File

@ -44,8 +44,8 @@ module Parfait
end
# determine whether this method has an argument by the name
def has_arg( name )
raise "has_arg #{name}.#{name.class}" unless name.is_a? Symbol
def has_argument( name )
raise "has_argument #{name}.#{name.class}" unless name.is_a? Symbol
index = arguments.variable_index( name )
index ? (index - 1) : index
end
@ -61,7 +61,7 @@ module Parfait
def argument_name( index )
arguments.names.get(index + 1)
end
def argument_type( index )
def arguments_type( index )
arguments.types.get(index + 1)
end