Skip to content

Commit 1387def

Browse files
committed
Remove methods have been obsolete over two decades
1 parent 911f9c6 commit 1387def

File tree

2 files changed

+0
-168
lines changed

2 files changed

+0
-168
lines changed

ext/jruby/org/jruby/ext/strscan/RubyStringScanner.java

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,6 @@ public IRubyObject terminate(ThreadContext context) {
188188
return this;
189189
}
190190

191-
@JRubyMethod(name = "clear")
192-
public IRubyObject clear(ThreadContext context) {
193-
check(context);
194-
Ruby runtime = context.runtime;
195-
if (runtime.isVerbose()) {
196-
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#clear is obsolete; use #terminate instead");
197-
}
198-
return terminate(context);
199-
}
200-
201191
@JRubyMethod(name = "string")
202192
public RubyString string() {
203193
return str;
@@ -504,15 +494,6 @@ public IRubyObject get_byte(ThreadContext context) {
504494
adjustRegisterPosition(regs.getEnd(0)));
505495
}
506496

507-
@JRubyMethod(name = "getbyte")
508-
public IRubyObject getbyte(ThreadContext context) {
509-
Ruby runtime = context.runtime;
510-
if (runtime.isVerbose()) {
511-
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#getbyte is obsolete; use #get_byte instead");
512-
}
513-
return get_byte(context);
514-
}
515-
516497
@JRubyMethod(name = "scan_byte")
517498
public IRubyObject scan_byte(ThreadContext context) {
518499
Ruby runtime = context.runtime;
@@ -558,15 +539,6 @@ public IRubyObject peek(ThreadContext context, IRubyObject length) {
558539
return extractBegLen(context.runtime, curr, len);
559540
}
560541

561-
@JRubyMethod(name = "peep")
562-
public IRubyObject peep(ThreadContext context, IRubyObject length) {
563-
Ruby runtime = context.runtime;
564-
if (runtime.isVerbose()) {
565-
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#peep is obsolete; use #peek instead");
566-
}
567-
return peek(context, length);
568-
}
569-
570542
@JRubyMethod(name = "scan_base10_integer", visibility = PRIVATE)
571543
public IRubyObject scan_base10_integer(ThreadContext context) {
572544
final Ruby runtime = context.runtime;
@@ -697,15 +669,6 @@ public RubyBoolean eos_p(ThreadContext context) {
697669
return curr >= str.getByteList().getRealSize() ? context.tru : context.fals;
698670
}
699671

700-
@JRubyMethod(name = "empty?")
701-
public RubyBoolean empty_p(ThreadContext context) {
702-
Ruby runtime = context.runtime;
703-
if (runtime.isVerbose()) {
704-
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#empty? is obsolete; use #eos? instead");
705-
}
706-
return eos_p(context);
707-
}
708-
709672
@JRubyMethod(name = "rest?")
710673
public RubyBoolean rest_p(ThreadContext context) {
711674
check(context);
@@ -734,15 +697,6 @@ public IRubyObject matched_size(ThreadContext context) {
734697
return RubyFixnum.newFixnum(context.runtime, regs.getEnd(0) - regs.getBeg(0));
735698
}
736699

737-
@JRubyMethod(name = "matchedsize")
738-
public IRubyObject matchedsize(ThreadContext context) {
739-
Ruby runtime = context.runtime;
740-
if (runtime.isVerbose()) {
741-
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#matchedsize is obsolete; use #matched_size instead");
742-
}
743-
return matched_size(context);
744-
}
745-
746700
@JRubyMethod(name = "[]")
747701
public IRubyObject op_aref(ThreadContext context, IRubyObject idx) {
748702
check(context);
@@ -827,15 +781,6 @@ public RubyFixnum rest_size(ThreadContext context) {
827781
return RubyFixnum.newFixnum(runtime, realSize - curr);
828782
}
829783

830-
@JRubyMethod(name = "restsize")
831-
public RubyFixnum restsize(ThreadContext context) {
832-
Ruby runtime = context.runtime;
833-
if (runtime.isVerbose()) {
834-
runtime.getWarnings().warning(ID.DEPRECATED_METHOD, "StringScanner#restsize is obsolete; use #rest_size instead");
835-
}
836-
return rest_size(context);
837-
}
838-
839784
@JRubyMethod(name = "inspect")
840785
@Override
841786
public IRubyObject inspect() {

ext/strscan/strscan.c

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ static VALUE strscan_init_copy _((VALUE vself, VALUE vorig));
9696

9797
static VALUE strscan_s_mustc _((VALUE self));
9898
static VALUE strscan_terminate _((VALUE self));
99-
static VALUE strscan_clear _((VALUE self));
10099
static VALUE strscan_get_string _((VALUE self));
101100
static VALUE strscan_set_string _((VALUE self, VALUE str));
102101
static VALUE strscan_concat _((VALUE self, VALUE str));
@@ -118,15 +117,11 @@ static VALUE strscan_search_full _((VALUE self, VALUE re,
118117
static void adjust_registers_to_matched _((struct strscanner *p));
119118
static VALUE strscan_getch _((VALUE self));
120119
static VALUE strscan_get_byte _((VALUE self));
121-
static VALUE strscan_getbyte _((VALUE self));
122120
static VALUE strscan_peek _((VALUE self, VALUE len));
123-
static VALUE strscan_peep _((VALUE self, VALUE len));
124121
static VALUE strscan_scan_base10_integer _((VALUE self));
125122
static VALUE strscan_unscan _((VALUE self));
126123
static VALUE strscan_bol_p _((VALUE self));
127124
static VALUE strscan_eos_p _((VALUE self));
128-
static VALUE strscan_empty_p _((VALUE self));
129-
static VALUE strscan_rest_p _((VALUE self));
130125
static VALUE strscan_matched_p _((VALUE self));
131126
static VALUE strscan_matched _((VALUE self));
132127
static VALUE strscan_matched_size _((VALUE self));
@@ -384,21 +379,6 @@ strscan_terminate(VALUE self)
384379
return self;
385380
}
386381

387-
/*
388-
* call-seq:
389-
* clear -> self
390-
*
391-
* This method is obsolete; use the equivalent method StringScanner#terminate.
392-
*/
393-
394-
/* :nodoc: */
395-
static VALUE
396-
strscan_clear(VALUE self)
397-
{
398-
rb_warning("StringScanner#clear is obsolete; use #terminate instead");
399-
return strscan_terminate(self);
400-
}
401-
402382
/*
403383
* :markup: markdown
404384
* :include: strscan/link_refs.txt
@@ -1217,22 +1197,6 @@ strscan_get_byte(VALUE self)
12171197
adjust_register_position(p, p->regs.end[0]));
12181198
}
12191199

1220-
/*
1221-
* call-seq:
1222-
* getbyte
1223-
*
1224-
* Equivalent to #get_byte.
1225-
* This method is obsolete; use #get_byte instead.
1226-
*/
1227-
1228-
/* :nodoc: */
1229-
static VALUE
1230-
strscan_getbyte(VALUE self)
1231-
{
1232-
rb_warning("StringScanner#getbyte is obsolete; use #get_byte instead");
1233-
return strscan_get_byte(self);
1234-
}
1235-
12361200
/*
12371201
* :markup: markdown
12381202
* :include: strscan/link_refs.txt
@@ -1268,22 +1232,6 @@ strscan_peek(VALUE self, VALUE vlen)
12681232
return extract_beg_len(p, p->curr, len);
12691233
}
12701234

1271-
/*
1272-
* call-seq:
1273-
* peep
1274-
*
1275-
* Equivalent to #peek.
1276-
* This method is obsolete; use #peek instead.
1277-
*/
1278-
1279-
/* :nodoc: */
1280-
static VALUE
1281-
strscan_peep(VALUE self, VALUE vlen)
1282-
{
1283-
rb_warning("StringScanner#peep is obsolete; use #peek instead");
1284-
return strscan_peek(self, vlen);
1285-
}
1286-
12871235
static VALUE
12881236
strscan_parse_integer(struct strscanner *p, int base, long len)
12891237
{
@@ -1523,45 +1471,6 @@ strscan_eos_p(VALUE self)
15231471
return EOS_P(p) ? Qtrue : Qfalse;
15241472
}
15251473

1526-
/*
1527-
* call-seq:
1528-
* empty?
1529-
*
1530-
* Equivalent to #eos?.
1531-
* This method is obsolete, use #eos? instead.
1532-
*/
1533-
1534-
/* :nodoc: */
1535-
static VALUE
1536-
strscan_empty_p(VALUE self)
1537-
{
1538-
rb_warning("StringScanner#empty? is obsolete; use #eos? instead");
1539-
return strscan_eos_p(self);
1540-
}
1541-
1542-
/*
1543-
* call-seq:
1544-
* rest?
1545-
*
1546-
* Returns true if and only if there is more data in the string. See #eos?.
1547-
* This method is obsolete; use #eos? instead.
1548-
*
1549-
* s = StringScanner.new('test string')
1550-
* # These two are opposites
1551-
* s.eos? # => false
1552-
* s.rest? # => true
1553-
*/
1554-
1555-
/* :nodoc: */
1556-
static VALUE
1557-
strscan_rest_p(VALUE self)
1558-
{
1559-
struct strscanner *p;
1560-
1561-
GET_SCANNER(self, p);
1562-
return EOS_P(p) ? Qfalse : Qtrue;
1563-
}
1564-
15651474
/*
15661475
* :markup: markdown
15671476
* :include: strscan/link_refs.txt
@@ -2052,22 +1961,6 @@ strscan_rest_size(VALUE self)
20521961
return INT2FIX(i);
20531962
}
20541963

2055-
/*
2056-
* call-seq:
2057-
* restsize
2058-
*
2059-
* <tt>s.restsize</tt> is equivalent to <tt>s.rest_size</tt>.
2060-
* This method is obsolete; use #rest_size instead.
2061-
*/
2062-
2063-
/* :nodoc: */
2064-
static VALUE
2065-
strscan_restsize(VALUE self)
2066-
{
2067-
rb_warning("StringScanner#restsize is obsolete; use #rest_size instead");
2068-
return strscan_rest_size(self);
2069-
}
2070-
20711964
#define INSPECT_LENGTH 5
20721965

20731966
/*
@@ -2308,7 +2201,6 @@ Init_strscan(void)
23082201
rb_define_singleton_method(StringScanner, "must_C_version", strscan_s_mustc, 0);
23092202
rb_define_method(StringScanner, "reset", strscan_reset, 0);
23102203
rb_define_method(StringScanner, "terminate", strscan_terminate, 0);
2311-
rb_define_method(StringScanner, "clear", strscan_clear, 0);
23122204
rb_define_method(StringScanner, "string", strscan_get_string, 0);
23132205
rb_define_method(StringScanner, "string=", strscan_set_string, 1);
23142206
rb_define_method(StringScanner, "concat", strscan_concat, 1);
@@ -2333,11 +2225,9 @@ Init_strscan(void)
23332225

23342226
rb_define_method(StringScanner, "getch", strscan_getch, 0);
23352227
rb_define_method(StringScanner, "get_byte", strscan_get_byte, 0);
2336-
rb_define_method(StringScanner, "getbyte", strscan_getbyte, 0);
23372228
rb_define_method(StringScanner, "scan_byte", strscan_scan_byte, 0);
23382229
rb_define_method(StringScanner, "peek", strscan_peek, 1);
23392230
rb_define_method(StringScanner, "peek_byte", strscan_peek_byte, 0);
2340-
rb_define_method(StringScanner, "peep", strscan_peep, 1);
23412231

23422232
rb_define_private_method(StringScanner, "scan_base10_integer", strscan_scan_base10_integer, 0);
23432233
rb_define_private_method(StringScanner, "scan_base16_integer", strscan_scan_base16_integer, 0);
@@ -2347,8 +2237,6 @@ Init_strscan(void)
23472237
rb_define_method(StringScanner, "beginning_of_line?", strscan_bol_p, 0);
23482238
rb_alias(StringScanner, rb_intern("bol?"), rb_intern("beginning_of_line?"));
23492239
rb_define_method(StringScanner, "eos?", strscan_eos_p, 0);
2350-
rb_define_method(StringScanner, "empty?", strscan_empty_p, 0);
2351-
rb_define_method(StringScanner, "rest?", strscan_rest_p, 0);
23522240

23532241
rb_define_method(StringScanner, "matched?", strscan_matched_p, 0);
23542242
rb_define_method(StringScanner, "matched", strscan_matched, 0);
@@ -2362,7 +2250,6 @@ Init_strscan(void)
23622250

23632251
rb_define_method(StringScanner, "rest", strscan_rest, 0);
23642252
rb_define_method(StringScanner, "rest_size", strscan_rest_size, 0);
2365-
rb_define_method(StringScanner, "restsize", strscan_restsize, 0);
23662253

23672254
rb_define_method(StringScanner, "inspect", strscan_inspect, 0);
23682255

0 commit comments

Comments
 (0)