diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-27 06:05:04 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-27 06:05:04 +0000 |
commit | 28651fcd3db70dc779fd2d8d119229d3721de34b (patch) | |
tree | 034956384b778251a1dd4090d2f19a43a0d0025b | |
parent | de3d93735d3babc6200bac593f5ec99ac876b3b4 (diff) | |
download | ruby-28651fcd3db70dc779fd2d8d119229d3721de34b.tar.gz ruby-28651fcd3db70dc779fd2d8d119229d3721de34b.tar.xz ruby-28651fcd3db70dc779fd2d8d119229d3721de34b.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@5565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | ext/curses/curses.c | 6 | ||||
-rw-r--r-- | ext/iconv/extconf.rb | 2 | ||||
-rw-r--r-- | lib/delegate.rb | 3 | ||||
-rw-r--r-- | lib/rexml/encodings/ISO-8859-1.rb | 2 | ||||
-rw-r--r-- | lib/weakref.rb | 16 | ||||
-rw-r--r-- | misc/ruby-mode.el | 8 | ||||
-rw-r--r-- | ruby.h | 8 |
9 files changed, 39 insertions, 24 deletions
@@ -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 diff --git a/Makefile.in b/Makefile.in index bbfe6f818..e3257c06d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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: diff --git a/ext/curses/curses.c b/ext/curses/curses.c index 106c43da4..0408fbd6b 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.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> diff --git a/ext/iconv/extconf.rb b/ext/iconv/extconf.rb index 36cd60ed1..73174a17f 100644 --- a/ext/iconv/extconf.rb +++ b/ext/iconv/extconf.rb @@ -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}/" diff --git a/lib/delegate.rb b/lib/delegate.rb index 1ba4cf1e1..6ceaa67d2 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -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 diff --git a/lib/rexml/encodings/ISO-8859-1.rb b/lib/rexml/encodings/ISO-8859-1.rb index 5beefbd40..32ddfbc90 100644 --- a/lib/rexml/encodings/ISO-8859-1.rb +++ b/lib/rexml/encodings/ISO-8859-1.rb @@ -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*') diff --git a/lib/weakref.rb b/lib/weakref.rb index 49b907ba1..c790055d0 100644 --- a/lib/weakref.rb +++ b/lib/weakref.rb @@ -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 diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 081218c40..106668de1 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -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) @@ -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 |