From 18bbd05709a4d52704ac217f30c0d9f35830b7f0 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 3 Jun 2015 01:39:16 +0000 Subject: * method.h: split rb_method_definition_t::flag to several flags. `flag' contains several categories of attributes and it makes us confusion (at least, I had confused). * rb_method_visibility_t (flags::visi) * NOEX_UNDEF -> METHOD_VISI_UNDEF = 0 * NOEX_PUBLIC -> METHOD_VISI_PUBLIC = 1 * NOEX_PRIVATE -> METHOD_VISI_PRIVATE = 2 * NOEX_PROTECTED -> METHOD_VISI_PROTECTED = 3 * NOEX_SAFE(flag)) -> safe (flags::safe, 2 bits) * NOEX_BASIC -> basic (flags::basic, 1 bit) * NOEX_MODFUNC -> rb_scope_visibility_t in CREF * NOEX_SUPER -> MISSING_SUPER (enum missing_reason) * NOEX_VCALL -> MISSING_VCALL (enum missing_reason) * NOEX_RESPONDS -> BOUND_RESPONDS (macro) Now, NOEX_NOREDEF is not supported (I'm not sure it is needed). Background: I did not know what "NOEX" stands for. I asked Matz (who made this name) and his answer was "Nothing". "At first, it meant NO EXport (private), but the original meaning was gone." This is why I remove the mysterious word "NOEX" from MRI. * vm_core.h: introduce `enum missing_reason' to represent method_missing (NoMethodError) reason. * eval_intern.h: introduce rb_scope_visibility_t to represent scope visibility. It has 3 method visibilities (public/private/protected) and `module_function`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index 36afbf1a57..d616e67cb4 100644 --- a/struct.c +++ b/struct.c @@ -177,7 +177,7 @@ define_aref_method(VALUE nstr, VALUE name, VALUE off) rb_control_frame_t *FUNC_FASTCALL(rb_vm_opt_struct_aref)(rb_thread_t *, rb_control_frame_t *); VALUE iseqval = rb_method_for_self_aref(name, off, rb_vm_opt_struct_aref); - rb_add_method_iseq(nstr, SYM2ID(name), iseqval, NULL, NOEX_PUBLIC); + rb_add_method_iseq(nstr, SYM2ID(name), iseqval, NULL, METHOD_VISI_PUBLIC); RB_GC_GUARD(iseqval); } @@ -187,7 +187,7 @@ define_aset_method(VALUE nstr, VALUE name, VALUE off) rb_control_frame_t *FUNC_FASTCALL(rb_vm_opt_struct_aset)(rb_thread_t *, rb_control_frame_t *); VALUE iseqval = rb_method_for_self_aset(name, off, rb_vm_opt_struct_aset); - rb_add_method_iseq(nstr, SYM2ID(name), iseqval, NULL, NOEX_PUBLIC); + rb_add_method_iseq(nstr, SYM2ID(name), iseqval, NULL, METHOD_VISI_PUBLIC); RB_GC_GUARD(iseqval); } -- cgit v1.2.3