aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--lib/getoptlong.rb9
-rw-r--r--lib/irb/slex.rb24
-rw-r--r--lib/rdoc/markup/simple_markup/inline.rb8
-rw-r--r--lib/rdoc/ri/ri_writer.rb2
5 files changed, 32 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 9cab9b391d..e71b8ac635 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,16 @@
-Sat Jun %-2d 08:17:23 2006 U-HUDIE\nobu,S-1-5-21-3746871489-166115513-3294629105-1005 <nobu@ruby-lang.org>
+Sat Jun 10 10:13:13 2006 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/getoptlong.rb (GetoptLong#set_options): recieve arguments
+ as Array.
+
+ * lib/irb/slex.rb: use Proc#yield.
+
+ * lib/rdoc/markup/simple_markup/inline.rb: follow the new behavior
+ of String#[].
+
+ * lib/rdoc/ri/ri_write.rb: ditto.
+
+Sat Jun 10 08:17:23 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* math.c (log2): may be a macro.
diff --git a/lib/getoptlong.rb b/lib/getoptlong.rb
index 922d25371c..880883a981 100644
--- a/lib/getoptlong.rb
+++ b/lib/getoptlong.rb
@@ -289,14 +289,7 @@ class GetoptLong
@canonical_names.clear
@argument_flags.clear
- arguments.each do |arg|
- #
- # Each argument must be an Array.
- #
- if !arg.is_a?(Array)
- raise ArgumentError, "the option list contains non-Array argument"
- end
-
+ arguments.each do |*arg|
#
# Find an argument flag and it set to `argument_flag'.
#
diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb
index 866bf30a5c..64321eb456 100644
--- a/lib/irb/slex.rb
+++ b/lib/irb/slex.rb
@@ -167,9 +167,9 @@ module IRB
def match(chrs, op = "")
D_DETAIL.print "match>: ", chrs, "op:", op, "\n"
if chrs.empty?
- if @preproc.nil? || @preproc.call(op, chrs)
+ if @preproc.nil? || @preproc.yield(op, chrs)
DOUT.printf(D_DETAIL, "op1: %s\n", op)
- @postproc.call(op, chrs)
+ @postproc.yield(op, chrs)
else
nil
end
@@ -180,9 +180,9 @@ module IRB
return ret
else
chrs.unshift ch
- if @postproc and @preproc.nil? || @preproc.call(op, chrs)
+ if @postproc and @preproc.nil? || @preproc.yield(op, chrs)
DOUT.printf(D_DETAIL, "op2: %s\n", op.inspect)
- ret = @postproc.call(op, chrs)
+ ret = @postproc.yield(op, chrs)
return ret
else
return nil
@@ -190,9 +190,9 @@ module IRB
end
else
chrs.unshift ch
- if @postproc and @preproc.nil? || @preproc.call(op, chrs)
+ if @postproc and @preproc.nil? || @preproc.yield(op, chrs)
DOUT.printf(D_DETAIL, "op3: %s\n", op)
- @postproc.call(op, chrs)
+ @postproc.yield(op, chrs)
return ""
else
return nil
@@ -211,9 +211,9 @@ module IRB
ch = io.getc_of_rests
end
if ch.nil?
- if @preproc.nil? || @preproc.call(op, io)
+ if @preproc.nil? || @preproc.yield(op, io)
D_DETAIL.printf("op1: %s\n", op)
- @postproc.call(op, io)
+ @postproc.yield(op, io)
else
nil
end
@@ -223,18 +223,18 @@ module IRB
ret
else
io.ungetc ch
- if @postproc and @preproc.nil? || @preproc.call(op, io)
+ if @postproc and @preproc.nil? || @preproc.yield(op, io)
DOUT.exec_if{D_DETAIL.printf "op2: %s\n", op.inspect}
- @postproc.call(op, io)
+ @postproc.yield(op, io)
else
nil
end
end
else
io.ungetc ch
- if @postproc and @preproc.nil? || @preproc.call(op, io)
+ if @postproc and @preproc.nil? || @preproc.yield(op, io)
D_DETAIL.printf("op3: %s\n", op)
- @postproc.call(op, io)
+ @postproc.yield(op, io)
else
nil
end
diff --git a/lib/rdoc/markup/simple_markup/inline.rb b/lib/rdoc/markup/simple_markup/inline.rb
index 1e76c201c9..9ca5857358 100644
--- a/lib/rdoc/markup/simple_markup/inline.rb
+++ b/lib/rdoc/markup/simple_markup/inline.rb
@@ -183,7 +183,7 @@ module SM
unless SPECIAL.empty?
SPECIAL.each do |regexp, attr|
str.scan(regexp) do
- attrs.set_attrs($`.length, $1.length, attr | Attribute::SPECIAL)
+ attrs.set_attrs($`.length, $&.length, attr | Attribute::SPECIAL)
end
end
end
@@ -215,6 +215,8 @@ module SM
add_html("b", :BOLD)
add_html("tt", :TT)
add_html("code", :TT)
+
+ add_special(/<!--(.*?)-->/, :COMMENT)
end
def add_word_pair(start, stop, name)
@@ -293,7 +295,7 @@ module SM
# skip leading invisible text
i = 0
- i += 1 while i < str_len and @str[i].zero?
+ i += 1 while i < str_len and @str[i] == "\0"
start_pos = i
# then scan the string, chunking it on attribute changes
@@ -319,7 +321,7 @@ module SM
# move on, skipping any invisible characters
begin
i += 1
- end while i < str_len and @str[i].zero?
+ end while i < str_len and @str[i] == "\0"
end
# tidy up trailing text
diff --git a/lib/rdoc/ri/ri_writer.rb b/lib/rdoc/ri/ri_writer.rb
index 78c68e8409..f1042fba79 100644
--- a/lib/rdoc/ri/ri_writer.rb
+++ b/lib/rdoc/ri/ri_writer.rb
@@ -13,7 +13,7 @@ module RI
# by %xx)
def RiWriter.internal_to_external(name)
- name.gsub(/\W/) { sprintf("%%%02x", $&[0]) }
+ name.gsub(/\W/) { "%%%02x" % $&[0].unpack('C') }
end
# And the reverse operation