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

* eval.c (rb_method_node): new API to retrieve method body.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-11-14 23:54:06 +00:00
parent 83e19791ef
commit ba2147ba40
5 changed files with 27 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Sat Nov 15 07:40:14 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_method_node): new API to retrieve method body.
Fri Nov 14 13:21:30 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: fix (en-bugged at 2003/11/07)

View file

@ -81,8 +81,8 @@ static VALUE
rb_ary_frozen_p(ary)
VALUE ary;
{
if (FL_TEST(ary, FL_FREEZE|ARY_TMPLOCK))
return Qtrue;
if (OBJ_FROZEN(ary)) return Qtrue;
if (FL_TEST(ary, ARY_TMPLOCK)) return Qtrue;
return Qfalse;
}

10
eval.c
View file

@ -421,6 +421,16 @@ rb_get_method_body(klassp, idp, noexp)
return body;
}
NODE*
rb_method_node(klass, id)
VALUE klass;
ID id;
{
int noex;
return rb_get_method_body(&klass, &id, &noex);
}
static void
remove_method(klass, mid)
VALUE klass;

9
hash.c
View file

@ -41,6 +41,14 @@ rb_hash_freeze(hash)
return rb_obj_freeze(hash);
}
static VALUE
rb_hash_frozen_p(hash)
VALUE hash;
{
if (OBJ_FROZEN(hash)) return Qtrue;
return Qfalse;
}
VALUE rb_cHash;
static VALUE envtbl;
@ -1789,6 +1797,7 @@ Init_Hash()
rb_define_method(rb_cHash,"to_a", rb_hash_to_a, 0);
rb_define_method(rb_cHash,"to_s", rb_hash_to_s, 0);
rb_define_method(rb_cHash,"inspect", rb_hash_inspect, 0);
rb_define_method(rb_cHash,"frozen?", rb_hash_frozen_p, 0);
rb_define_method(rb_cHash,"==", rb_hash_equal, 1);
rb_define_method(rb_cHash,"[]", rb_hash_aref, 1);

2
node.h
View file

@ -352,6 +352,8 @@ NODE *rb_compile_file _((const char*, VALUE, int));
void rb_add_method _((VALUE, ID, NODE *, int));
NODE *rb_node_newnode _((enum node_type,VALUE,VALUE,VALUE));
NODE* rb_method_node _((VALUE klass, ID id));
struct global_entry *rb_global_entry _((ID));
VALUE rb_gvar_get _((struct global_entry *));
VALUE rb_gvar_set _((struct global_entry *, VALUE));