more symbol related fixes
This commit is contained in:
@ -37,7 +37,7 @@ module Parfait
|
||||
# used to determine if a send must be issued
|
||||
# return index of the name into the message if so
|
||||
def has_var name
|
||||
raise "uups #{name}.#{name.class}" unless name.is_a? Word
|
||||
raise "uups #{name}.#{name.class}" unless name.is_a? Symbol
|
||||
index = has_arg(name)
|
||||
return index if index
|
||||
has_local(name)
|
||||
@ -45,22 +45,22 @@ module Parfait
|
||||
|
||||
# determine whether this method has an argument by the name
|
||||
def has_arg name
|
||||
raise "uups #{name}.#{name.class}" unless name.is_a? Word
|
||||
raise "uups #{name}.#{name.class}" unless name.is_a? Symbol
|
||||
@arg_names.index_of name
|
||||
end
|
||||
|
||||
# determine if method has a local variable or tmp (anonymous local) by given name
|
||||
def has_local name
|
||||
raise "uups #{name}.#{name.class}" unless name.is_a? Word
|
||||
index = @locals.index(name)
|
||||
index = @tmps.index(name) unless index
|
||||
raise "uups #{name}.#{name.class}" unless name.is_a? Symbol
|
||||
index = @locals.index_of(name)
|
||||
index = @tmps.index_of(name) unless index
|
||||
index
|
||||
end
|
||||
|
||||
def ensure_local name
|
||||
index = has_local name
|
||||
return index if index
|
||||
@locals << name
|
||||
@locals.push name
|
||||
@locals.length
|
||||
end
|
||||
|
||||
|
@ -36,7 +36,7 @@ module Virtual
|
||||
# compile code then works with the method, but adds code tot the info
|
||||
def self.create_method( class_name , method_name , args)
|
||||
raise "uups #{class_name}.#{class_name.class}" unless class_name.is_a? Symbol
|
||||
raise "uups #{method_name}.#{method_name.class}" unless class_name.is_a? Symbol
|
||||
raise "uups #{method_name}.#{method_name.class}" unless method_name.is_a? Symbol
|
||||
clazz = Virtual.machine.space.get_class_by_name class_name
|
||||
raise "No such class #{class_name}" unless clazz
|
||||
method = clazz.create_instance_method( method_name , Virtual.new_list(args))
|
||||
|
@ -18,10 +18,10 @@ module Virtual
|
||||
r = Self.new()
|
||||
class_name = method.for_class.name
|
||||
end
|
||||
new_method = CompiledMethodInfo.create_method(class_name, expression.name.to_s , args )
|
||||
new_method = CompiledMethodInfo.create_method(class_name, expression.name , args )
|
||||
new_method.info.receiver = r
|
||||
new_method.for_class.add_instance_method new_method
|
||||
|
||||
|
||||
#frame = frame.new_frame
|
||||
return_type = nil
|
||||
expression.body.each do |ex|
|
||||
|
Reference in New Issue
Block a user