From b83ed6d1bd710c0f3397dafbba3b96e1311bcc6a Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 23 Feb 2007 02:49:41 +0000 Subject: * parse.y, compile.c, gc.c, insns.def, intern.h, iseq.c, node.h, object.c, string.c, variable.c, vm_macro.def: revert private instance variable feature, which is postponed until next major release. * marshal.c: TYPE_SYMBOL2 removed; MARSHAL_MINOR reverted back to 8th version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 5ce8d73e30..77f334abfc 100644 --- a/string.c +++ b/string.c @@ -4685,9 +4685,6 @@ sym_inspect(VALUE sym) VALUE str, klass = Qundef; ID id = SYM2ID(sym); - if (rb_is_instance2_id(id)) { - id = rb_decompose_ivar2(id, &klass); - } sym = rb_id2str(id); str = rb_str_new(0, RSTRING_LEN(sym)+1); RSTRING_PTR(str)[0] = ':'; @@ -4721,9 +4718,6 @@ rb_sym_to_s(VALUE sym) { ID id = SYM2ID(sym); - if (rb_is_instance2_id(id)) { - id = rb_decompose_ivar2(id, 0); - } return str_new3(rb_cString, rb_id2str(id)); } @@ -4876,27 +4870,6 @@ rb_to_id(VALUE name) return id; } -static VALUE -sym_div(VALUE sym, VALUE klass) -{ - ID id = SYM2ID(sym); - - if (!rb_is_instance2_id(id)) { - rb_raise(rb_eArgError, "symbol %s should be local instance variable", - rb_id2name(id)); - } - switch (TYPE(klass)) { - case T_CLASS: - case T_MODULE: - break; - default: - rb_check_type(klass, T_CLASS); - break; - } - id = rb_compose_ivar2(id, klass); - return ID2SYM(id); -} - /* * A String object holds and manipulates an arbitrary sequence of * bytes, typically representing characters. String objects may be created @@ -5037,7 +5010,6 @@ Init_String(void) rb_define_singleton_method(rb_cSymbol, "all_symbols", rb_sym_all_symbols, 0); /* in parse.y */ rb_define_singleton_method(rb_cSymbol, "intern", rb_sym_s_intern, 1); - rb_define_method(rb_cSymbol, "/", sym_div, 1); rb_define_method(rb_cSymbol, "==", sym_equal, 1); rb_define_method(rb_cSymbol, "to_i", sym_to_i, 0); rb_define_method(rb_cSymbol, "inspect", sym_inspect, 0); -- cgit v1.2.3