summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-01 09:18:11 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-01 09:18:11 +0000
commit5c3523de765b41584cfcebb8aebbaa6ac9433c35 (patch)
tree6f7bcd6f2beee4a3061b59e5885efed0605edb00
parent87b67b575c4d5dc428ee1f33f0f4d546e5111c10 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog2
-rw-r--r--instruby.rb2
-rw-r--r--parse.y8
-rw-r--r--re.c9
-rw-r--r--string.c2
5 files changed, 13 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 5cca8c8aed..fabb2af7a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@ Fri Sep 1 10:36:45 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
Fri Sep 1 10:36:29 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * re.c (match_aref): should use rb_reg_nth_match().
+
* eval.c (POP_SCOPE): recycled scopes too much
* eval.c (Init_eval): extend room for stack allowance.
diff --git a/instruby.rb b/instruby.rb
index f28dbea7b9..a8d164cd51 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -93,7 +93,7 @@ end
File.install wdir+'/'+CONFIG['LIBRUBY_A'], archlibdir, 0644, true
File.makedirs mandir, true
-File.install "ruby.1", mandir, 0644, true
+File.install "ruby.1", mandir+"/"+ruby_install_name+".1", 0644, true
Dir.chdir wdir
File.install "config.h", archlibdir, 0644, true
File.install "rbconfig.rb", archlibdir, 0644, true
diff --git a/parse.y b/parse.y
index a9416a7abf..5580500f91 100644
--- a/parse.y
+++ b/parse.y
@@ -859,6 +859,10 @@ aref_args : none
{
$$ = NEW_LIST($1);
}
+ | block_call opt_nl
+ {
+ $$ = NEW_LIST($1);
+ }
| args opt_nl
{
$$ = $1;
@@ -888,6 +892,10 @@ aref_args : none
opt_call_args : none
| call_args opt_nl
+ | block_call opt_nl
+ {
+ $$ = NEW_LIST($1);
+ }
call_args : command_call
{
diff --git a/re.c b/re.c
index 647f17bb15..eeb89cf129 100644
--- a/re.c
+++ b/re.c
@@ -777,14 +777,7 @@ match_aref(argc, argv, match)
if (!NIL_P(rest) || !FIXNUM_P(idx) || FIX2INT(idx) < 0) {
return rb_ary_aref(argc, argv, match_to_a(match));
}
-
- regs = RMATCH(match)->regs;
- i = FIX2INT(idx);
-
- if (i >= regs->num_regs) return Qnil;
-
- ptr = RSTRING(RMATCH(match)->str)->ptr;
- return rb_str_new(ptr+regs->beg[i], regs->end[i]-regs->beg[i]);
+ return rb_reg_nth_match(FIX2INT(idx), match);
}
static VALUE
diff --git a/string.c b/string.c
index 01f3f03d15..6343a2af5f 100644
--- a/string.c
+++ b/string.c
@@ -2579,7 +2579,7 @@ rb_str_scan(str, pat)
match = rb_backref_get();
rb_match_busy(match);
rb_yield(result);
- rb_backref_set(match);
+ rb_backref_set(match); /* restore $~ value */
}
rb_backref_set(match);
return str;