mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* misc/ruby-mode.el: better support for general delimited
strings. [ruby-dev:22695] * lib/weakref.rb (WeakRef::initialize): set up @__id before calling "super". * lib/delegate.rb (Delegator::initialize): preserve singleton_method_added method [ruby-dev:22685] * lib/delegate.rb (Delegator::initialize): use Kernel::raise instead of mere raise. [ruby-dev:22681] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									8df4564367
								
							
						
					
					
						commit
						51e6d9061d
					
				
					 9 changed files with 39 additions and 24 deletions
				
			
		
							
								
								
									
										16
									
								
								ChangeLog
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								ChangeLog
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,3 +1,8 @@
 | 
			
		|||
Tue Jan 27 15:00:14 2004  Yukihiro Matsumoto  <matz@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* misc/ruby-mode.el: better support for general delimited
 | 
			
		||||
	  strings.  [ruby-dev:22695]
 | 
			
		||||
 | 
			
		||||
Tue Jan 27 11:04:40 2004  FUKUMOTO Atsushi  <fukumoto@nospam.imasy.or.jp>
 | 
			
		||||
 | 
			
		||||
	* ext/socket/socket.c (s_recvfrom): sending length should be an
 | 
			
		||||
| 
						 | 
				
			
			@ -16,6 +21,17 @@ Mon Jan 26 22:53:04 2004  Dave Thomas  <dave@pragprog.com>
 | 
			
		|||
 | 
			
		||||
	* io.c: Remove documentation references to $defout.
 | 
			
		||||
 | 
			
		||||
Mon Jan 26 14:41:46 2004  Yukihiro Matsumoto  <matz@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* lib/weakref.rb (WeakRef::initialize): set up @__id before
 | 
			
		||||
	  calling "super".
 | 
			
		||||
 | 
			
		||||
	* lib/delegate.rb (Delegator::initialize): preserve
 | 
			
		||||
	  singleton_method_added method [ruby-dev:22685]
 | 
			
		||||
 | 
			
		||||
	* lib/delegate.rb (Delegator::initialize): use Kernel::raise
 | 
			
		||||
	  instead of mere raise.  [ruby-dev:22681]
 | 
			
		||||
 | 
			
		||||
Mon Jan 26 12:45:23 2004  Hidetoshi NAGAI  <nagai@ai.kyutech.ac.jp>
 | 
			
		||||
 | 
			
		||||
	* ext/tcltklib/tcltklib.c: define CONST84 when TCL_MAJOR_VERSION == 7
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -229,7 +229,7 @@ $(srcdir)/configure: $(srcdir)/configure.in
 | 
			
		|||
 | 
			
		||||
lex.c: keywords
 | 
			
		||||
	@-rm -f $@
 | 
			
		||||
	gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $> > $@ || \
 | 
			
		||||
	gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $< > $@ || \
 | 
			
		||||
	cp "$(srcdir)/$@" .
 | 
			
		||||
 | 
			
		||||
.y.c:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,11 @@
 | 
			
		|||
#elif defined(HAVE_NCURSES_CURSES_H)
 | 
			
		||||
# include <ncurses/curses.h>
 | 
			
		||||
#elif defined(HAVE_CURSES_COLR_CURSES_H)
 | 
			
		||||
# include <varargs.h>
 | 
			
		||||
# ifdef HAVE_STDARG_PROTOTYPES
 | 
			
		||||
#  include <stdarg.h>
 | 
			
		||||
# else
 | 
			
		||||
#  include <varargs.h>
 | 
			
		||||
# endif
 | 
			
		||||
# include <curses_colr/curses.h>
 | 
			
		||||
#else
 | 
			
		||||
# include <curses.h>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,7 @@ test(iconv_t cd, char **inptr, size_t *inlen, char **outptr, size_t *outlen)
 | 
			
		|||
  else
 | 
			
		||||
    $defs.push('-DICONV_INPTR_CAST="(char **)"')
 | 
			
		||||
  end
 | 
			
		||||
  have_library("iconv")
 | 
			
		||||
  have_library("iconv", "iconv")
 | 
			
		||||
  if conf
 | 
			
		||||
    prefix = '$(srcdir)'
 | 
			
		||||
    prefix =  $nmake ? "{#{prefix}}" : "#{prefix}/"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,6 +27,7 @@ class Delegator
 | 
			
		|||
      preserved |= t.protected_instance_methods(false)
 | 
			
		||||
      break if t == Delegator
 | 
			
		||||
    end
 | 
			
		||||
    preserved << "singleton_method_added"
 | 
			
		||||
    for method in obj.methods
 | 
			
		||||
      next if preserved.include? method
 | 
			
		||||
      begin
 | 
			
		||||
| 
						 | 
				
			
			@ -37,7 +38,7 @@ class Delegator
 | 
			
		|||
	    rescue Exception
 | 
			
		||||
	      $@.delete_if{|s| /:in `__getobj__'$/ =~ s} #`
 | 
			
		||||
	      $@.delete_if{|s| /^\\(eval\\):/ =~ s}
 | 
			
		||||
	      raise
 | 
			
		||||
	      ::Kernel::raise
 | 
			
		||||
	    end
 | 
			
		||||
	  end
 | 
			
		||||
	EOS
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
module REXML
 | 
			
		||||
  module Encoding
 | 
			
		||||
    @@__REXML_encoding_methods =<<-EOL
 | 
			
		||||
    @@__REXML_encoding_methods =<<-'EOL'
 | 
			
		||||
    # Convert from UTF-8
 | 
			
		||||
    def encode content
 | 
			
		||||
      array_utf8 = content.unpack('U*')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,8 +41,7 @@ class WeakRef<Delegator
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  def initialize(orig)
 | 
			
		||||
    super
 | 
			
		||||
    @__id = orig.__id__
 | 
			
		||||
    @__id = orig.object_id
 | 
			
		||||
    ObjectSpace.define_finalizer orig, @@final
 | 
			
		||||
    ObjectSpace.define_finalizer self, @@final
 | 
			
		||||
    __old_status = Thread.critical
 | 
			
		||||
| 
						 | 
				
			
			@ -52,23 +51,24 @@ class WeakRef<Delegator
 | 
			
		|||
    ensure
 | 
			
		||||
      Thread.critical = __old_status
 | 
			
		||||
    end
 | 
			
		||||
    @@id_map[@__id].push self.__id__
 | 
			
		||||
    @@id_rev_map[self.__id__] = @__id
 | 
			
		||||
    @@id_map[@__id].push self.object_id
 | 
			
		||||
    @@id_rev_map[self.object_id] = @__id
 | 
			
		||||
    super 
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def __getobj__
 | 
			
		||||
    unless @@id_rev_map[self.__id__] == @__id
 | 
			
		||||
      raise RefError, "Illegal Reference - probably recycled", caller(2)
 | 
			
		||||
    unless @@id_rev_map[self.object_id] == @__id
 | 
			
		||||
      Kernel::raise RefError, "Illegal Reference - probably recycled", Kernel::caller(2)
 | 
			
		||||
    end
 | 
			
		||||
    begin
 | 
			
		||||
      ObjectSpace._id2ref(@__id)
 | 
			
		||||
    rescue RangeError
 | 
			
		||||
      raise RefError, "Illegal Reference - probably recycled", caller(2)
 | 
			
		||||
      Kernel::raise RefError, "Illegal Reference - probably recycled", Kernel::caller(2)
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def weakref_alive?
 | 
			
		||||
    @@id_rev_map[self.__id__] == @__id
 | 
			
		||||
    @@id_rev_map[self.object_id] == @__id
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1013,10 +1013,6 @@ balanced expression is found."
 | 
			
		|||
	  ("\\(^\\|[=(,~?:;]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)"
 | 
			
		||||
	   (4 (7 . ?/))
 | 
			
		||||
	   (6 (7 . ?/)))
 | 
			
		||||
	  ;; %Q!...!
 | 
			
		||||
	  ("\\(^\\|[[ \t\n<+(,=]\\)%[xrqQwW]?\\([^<[{(a-zA-Z0-9 \n]\\)[^\n\\\\]*\\(\\\\.[^\n\\\\]*\\)*\\(\\2\\)"
 | 
			
		||||
	   (2 (7 . nil))
 | 
			
		||||
	   (4 (7 . nil)))
 | 
			
		||||
	  ("^\\(=\\)begin\\(\\s \\|$\\)" 1 (7 . nil))
 | 
			
		||||
	  ("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))))
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1098,7 +1094,6 @@ balanced expression is found."
 | 
			
		|||
	    t)
 | 
			
		||||
          nil)))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  (defvar ruby-font-lock-keywords
 | 
			
		||||
    (list
 | 
			
		||||
     ;; functions
 | 
			
		||||
| 
						 | 
				
			
			@ -1168,6 +1163,9 @@ balanced expression is found."
 | 
			
		|||
       0 font-lock-string-face t)
 | 
			
		||||
     `(,ruby-here-doc-beg-re
 | 
			
		||||
       0 font-lock-string-face t)
 | 
			
		||||
     ;; general delimited string
 | 
			
		||||
     '("\\(^\\|[[ \t\n<+(,=]\\)\\(%[xrqQwW]?\\([^<[{(a-zA-Z0-9 \n]\\)[^\n\\\\]*\\(\\\\.[^\n\\\\]*\\)*\\(\\3\\)\\)"
 | 
			
		||||
       (2 font-lock-string-face))
 | 
			
		||||
     ;; constants
 | 
			
		||||
     '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)"
 | 
			
		||||
       2 font-lock-type-face)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								ruby.h
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								ruby.h
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -638,9 +638,7 @@ rb_class_of(obj)
 | 
			
		|||
	if (obj == Qnil)   return rb_cNilClass;
 | 
			
		||||
	if (obj == Qfalse) return rb_cFalseClass;
 | 
			
		||||
    }
 | 
			
		||||
    else{
 | 
			
		||||
	return RBASIC(obj)->klass;
 | 
			
		||||
    }
 | 
			
		||||
    return RBASIC(obj)->klass;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline int
 | 
			
		||||
| 
						 | 
				
			
			@ -661,9 +659,7 @@ rb_type(obj)
 | 
			
		|||
	if (obj == Qnil) return T_NIL;
 | 
			
		||||
	if (obj == Qfalse) return T_FALSE;
 | 
			
		||||
    }
 | 
			
		||||
    else{
 | 
			
		||||
	return BUILTIN_TYPE(obj);
 | 
			
		||||
    }
 | 
			
		||||
    return BUILTIN_TYPE(obj);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline int
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue