1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/strscan/strscan.c (Init_strscan): remove obsolete

matchedsize method, use matched_size instead.  [ruby-dev:38591]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-06-17 04:57:11 +00:00
parent 945ea61cd7
commit d121a3fb79
3 changed files with 6 additions and 14 deletions

View file

@ -1,3 +1,8 @@
Wed Jun 17 13:54:18 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/strscan/strscan.c (Init_strscan): remove obsolete
matchedsize method, use matched_size instead. [ruby-dev:38591]
Wed Jun 17 12:37:37 2009 Yukihiro Matsumoto <matz@ruby-lang.org> Wed Jun 17 12:37:37 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* thread.c (ruby_thread_stack_overflow): call rb_exc_raise() on * thread.c (ruby_thread_stack_overflow): call rb_exc_raise() on

View file

@ -930,17 +930,6 @@ strscan_matched_size(VALUE self)
return INT2NUM(p->regs.end[0] - p->regs.beg[0]); return INT2NUM(p->regs.end[0] - p->regs.beg[0]);
} }
/*
* Equivalent to #matched_size.
* This method is obsolete; use #matched_size instead.
*/
static VALUE
strscan_matchedsize(VALUE self)
{
rb_warning("StringScanner#matchedsize is obsolete; use #matched_size instead");
return strscan_matched_size(self);
}
/* /*
* call-seq: [](n) * call-seq: [](n)
* *
@ -1317,7 +1306,6 @@ Init_strscan()
rb_define_method(StringScanner, "matched?", strscan_matched_p, 0); rb_define_method(StringScanner, "matched?", strscan_matched_p, 0);
rb_define_method(StringScanner, "matched", strscan_matched, 0); rb_define_method(StringScanner, "matched", strscan_matched, 0);
rb_define_method(StringScanner, "matched_size", strscan_matched_size, 0); rb_define_method(StringScanner, "matched_size", strscan_matched_size, 0);
rb_define_method(StringScanner, "matchedsize", strscan_matchedsize, 0);
rb_define_method(StringScanner, "[]", strscan_aref, 1); rb_define_method(StringScanner, "[]", strscan_aref, 1);
rb_define_method(StringScanner, "pre_match", strscan_pre_match, 0); rb_define_method(StringScanner, "pre_match", strscan_pre_match, 0);
rb_define_method(StringScanner, "post_match", strscan_post_match, 0); rb_define_method(StringScanner, "post_match", strscan_post_match, 0);

View file

@ -528,9 +528,8 @@ class TestStringScanner < Test::Unit::TestCase
s.terminate s.terminate
assert_nil s.matched_size assert_nil s.matched_size
# obsolete
s = StringScanner.new('test string') s = StringScanner.new('test string')
assert_nil s.matchedsize assert_nil s.matched_size
s.scan(/test/) s.scan(/test/)
assert_equal 4, s.matched_size assert_equal 4, s.matched_size
s.terminate s.terminate