From c039f3d6e6a89a5e66fbcb37f4fb02646fe9d5d6 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Mon, 17 Aug 2015 02:37:07 +0300 Subject: [PATCH] fix the string warning raises --- lib/parfait/method.rb | 6 +++--- lib/parfait/module.rb | 6 +++--- lib/parfait/space.rb | 4 ++-- lib/virtual/compiler/basic_expressions.rb | 2 +- lib/virtual/method_source.rb | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/parfait/method.rb b/lib/parfait/method.rb index 6a96e67c..04879fdd 100644 --- a/lib/parfait/method.rb +++ b/lib/parfait/method.rb @@ -38,7 +38,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? Symbol + raise "has_var #{name}.#{name.class}" unless name.is_a? Symbol index = has_arg(name) return index if index has_local(name) @@ -46,13 +46,13 @@ 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? Symbol + raise "has_arg #{name}.#{name.class}" unless name.is_a? Symbol self.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? Symbol + raise "has_local #{name}.#{name.class}" unless name.is_a? Symbol index = self.locals.index_of(name) index = self.tmps.index_of(name) unless index index diff --git a/lib/parfait/module.rb b/lib/parfait/module.rb index 234444cc..a3ad6472 100644 --- a/lib/parfait/module.rb +++ b/lib/parfait/module.rb @@ -59,7 +59,7 @@ module Parfait end def create_instance_method method_name , arg_names - raise "uups #{method_name}.#{method_name.class}" unless method_name.is_a?(Symbol) + raise "create_instance_method #{method_name}.#{method_name.class}" unless method_name.is_a?(Symbol) clazz = object_layout().object_class() raise "??? #{method_name}" unless clazz #puts "Self: #{self.class} clazz: #{clazz.name}" @@ -74,7 +74,7 @@ module Parfait end def get_instance_method fname - raise "uups #{fname}.#{fname.class}" unless fname.is_a?(Symbol) + raise "get_instance_method #{fname}.#{fname.class}" unless fname.is_a?(Symbol) #if we had a hash this would be easier. Detect or find would help too self.instance_methods.each do |m| return m if(m.name == fname ) @@ -84,7 +84,7 @@ module Parfait # get the method and if not found, try superclasses. raise error if not found def resolve_method m_name - raise "uups #{m_name}.#{m_name.class}" unless m_name.is_a?(Symbol) + raise "resolve_method #{m_name}.#{m_name.class}" unless m_name.is_a?(Symbol) method = get_instance_method(m_name) return method if method if( self.super_class ) diff --git a/lib/parfait/space.rb b/lib/parfait/space.rb index bb92509f..bcc8bc85 100644 --- a/lib/parfait/space.rb +++ b/lib/parfait/space.rb @@ -60,7 +60,7 @@ module Parfait # get a class by name (symbol) # return nili if no such class. Use bang version if create should be implicit def get_class_by_name name - raise "uups #{name}.#{name.class}" unless name.is_a?(Symbol) + raise "get_class_by_name #{name}.#{name.class}" unless name.is_a?(Symbol) c = self.classes[name] #puts "MISS, no class #{name} #{name.class}" unless c # " #{self.classes}" #puts "CLAZZ, #{name} #{c.get_layout.get_length}" if c @@ -78,7 +78,7 @@ module Parfait # this is the way to instantiate classes (not Parfait::Class.new) # so we get and keep exactly one per name def create_class name , superclass - raise "uups #{name.class}" unless name.is_a? Symbol + raise "create_class #{name.class}" unless name.is_a? Symbol c = Class.new(name , superclass) self.classes[name] = c end diff --git a/lib/virtual/compiler/basic_expressions.rb b/lib/virtual/compiler/basic_expressions.rb index 41ba9e62..45d24d18 100644 --- a/lib/virtual/compiler/basic_expressions.rb +++ b/lib/virtual/compiler/basic_expressions.rb @@ -39,7 +39,7 @@ module Virtual def self.compile_modulename expression , method clazz = Parfait::Space.object_space.get_class_by_name expression.name - raise "uups #{clazz}.#{name}" unless clazz + raise "compile_modulename #{clazz}.#{name}" unless clazz to = Return.new(Reference , clazz ) method.source.add_code Set.new( clazz , to ) to diff --git a/lib/virtual/method_source.rb b/lib/virtual/method_source.rb index 98a6fbab..a884286c 100644 --- a/lib/virtual/method_source.rb +++ b/lib/virtual/method_source.rb @@ -35,8 +35,8 @@ 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 method_name.is_a? Symbol + raise "create_method #{class_name}.#{class_name.class}" unless class_name.is_a? Symbol + raise "create_method #{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))