Skip to content

Commit

Permalink
matz
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Sep 1, 2000
1 parent 87b67b5 commit 5c3523d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Fri Sep 1 10:36:45 2000 Yukihiro Matsumoto <[email protected]>

Fri Sep 1 10:36:29 2000 Yukihiro Matsumoto <[email protected]>

* 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.
Expand Down
2 changes: 1 addition & 1 deletion instruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
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
Expand Down
8 changes: 8 additions & 0 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,10 @@ aref_args : none
{
$$ = NEW_LIST($1);
}
| block_call opt_nl
{
$$ = NEW_LIST($1);
}
| args opt_nl
{
$$ = $1;
Expand Down Expand Up @@ -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
{
Expand Down
9 changes: 1 addition & 8 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5c3523d

Please sign in to comment.