From: Brian Takita Date: 2006-01-25T13:41:35+09:00 Subject: Re: Two Lines of C in Ruby Source ------=_Part_8724_14982276.1138164082383 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > > Spoiler warning: > > http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/140058 > Thank you for your help Christian. Would there be a way to access the Node struct from a Ruby object? My objective is to find all of the file and line numbers of the class, module, and method definitions. To me, it looks like it would require significant rewriting of the Ruby cor= e to easily achieve this. The reason is I'm looking at #define NEW_METHOD(n,x) NEW_NODE(NODE_METHOD,x,n,0) ... #define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS #define NEW_SCLASS(r,b) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(b),0),n,NEW_SCOPE(b),(s)) #define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(b),0) in node.h They are all called in parse.y, parse.c, class.c, and eval.c It looks like set_trace_func is the best way to achieve this goal. Thank you, Brian Takita ------=_Part_8724_14982276.1138164082383--