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: StringScanner#restsize is obsolete; use #rest_size instead.

* ext/strscan/strscan.c: StringScanner#matchedsize is obsolete; use #matched_size instead.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2004-02-18 18:06:14 +00:00
parent e55e640a6f
commit b06f1fb429
2 changed files with 35 additions and 3 deletions

View file

@ -1,3 +1,11 @@
Thu Feb 19 03:05:49 2004 Minero Aoki <aamine@loveruby.net>
* ext/strscan/strscan.c: StringScanner#restsize is obsolete;
use #rest_size instead.
* ext/strscan/strscan.c: StringScanner#matchedsize is obsolete;
use #matched_size instead.
Thu Feb 19 02:42:19 2004 Minero Aoki <aamine@loveruby.net>
* ext/strscan/strscan.c: don't use rb_eval_string, it defines

View file

@ -934,6 +934,18 @@ strscan_matched_size(self)
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(self)
VALUE self;
{
rb_warning("StringScanner#matchedsize is obsolete; use #matched_size instead");
return strscan_matched_size(self);
}
/*
* call-seq: [](n)
*
@ -1013,7 +1025,7 @@ strscan_post_match(self)
/*
* Returns the "rest" of the string (i.e. everything after the scan pointer).
* If there is no more data, it returns <tt>""</tt>.
* If there is no more data (eos? = true), it returns <tt>""</tt>.
*/
static VALUE
strscan_rest(self)
@ -1047,6 +1059,18 @@ strscan_rest_size(self)
return INT2FIX(i);
}
/*
* <tt>s.restsize</tt> is equivalent to <tt>s.rest_size</tt>.
* This method is obsolete; use #rest_size instead.
*/
static VALUE
strscan_restsize(self)
VALUE self;
{
rb_warning("StringScanner#restsize is obsolete; use #rest_size instead");
return strscan_rest_size(self);
}
#define INSPECT_LENGTH 5
#define BUFSIZE 256
@ -1304,14 +1328,14 @@ Init_strscan()
rb_define_method(StringScanner, "matched?", strscan_matched_p, 0);
rb_define_method(StringScanner, "matched", strscan_matched, 0);
rb_define_method(StringScanner, "matched_size", strscan_matched_size, 0);
rb_define_method(StringScanner, "matchedsize", strscan_matched_size, 0);
rb_define_method(StringScanner, "matchedsize", strscan_matchedsize, 0);
rb_define_method(StringScanner, "[]", strscan_aref, 1);
rb_define_method(StringScanner, "pre_match", strscan_pre_match, 0);
rb_define_method(StringScanner, "post_match", strscan_post_match, 0);
rb_define_method(StringScanner, "rest", strscan_rest, 0);
rb_define_method(StringScanner, "rest_size", strscan_rest_size, 0);
rb_define_method(StringScanner, "restsize", strscan_rest_size, 0);
rb_define_method(StringScanner, "restsize", strscan_restsize, 0);
rb_define_method(StringScanner, "inspect", strscan_inspect, 0);
}