summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-27 06:05:04 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-27 06:05:04 +0000
commit51e6d9061dc8090bd1c9e3a1a8dadbbd9294a48d (patch)
tree034956384b778251a1dd4090d2f19a43a0d0025b
parent8df4564367f895a5ba6f9186f7c90ebd07c874bb (diff)
* 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
-rw-r--r--ChangeLog16
-rw-r--r--Makefile.in2
-rw-r--r--ext/curses/curses.c6
-rw-r--r--ext/iconv/extconf.rb2
-rw-r--r--lib/delegate.rb3
-rw-r--r--lib/rexml/encodings/ISO-8859-1.rb2
-rw-r--r--lib/weakref.rb16
-rw-r--r--misc/ruby-mode.el8
-rw-r--r--ruby.h8
9 files changed, 39 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 13a6c0fa427..4b1e6443751 100644
--- a/ChangeLog
+++ b/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
diff --git a/Makefile.in b/Makefile.in
index bbfe6f8186a..e3257c06d9a 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 106c43da4c8..0408fbd6bc7 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 36cd60ed151..73174a17f2a 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 1ba4cf1e1b9..6ceaa67d29f 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 5beefbd408f..32ddfbc909e 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 49b907ba17a..c790055d01e 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 081218c4080..106668de198 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)
diff --git a/ruby.h b/ruby.h
index 8790a2863b9..f9dad9b08a2 100644
--- a/ruby.h
+++ b/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