diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-11 00:36:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-11 00:36:38 +0000 |
commit | 91d884b86e3cd51962360eea8db2307c0ad61678 (patch) | |
tree | 690072aaad89d58629f353967741bc52142bf408 | |
parent | d1bdb139ea33ba0248c15c62eb4e18ecb491bd12 (diff) | |
download | ruby-91d884b86e3cd51962360eea8db2307c0ad61678.tar.gz |
* eval.c (rb_eval): set line number from all nodes.
* eval.c (proc_to_s): show source file/line if available.
* marshal.c (r_object): register TYPE_BIGNUM regardless real type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | eval.c | 18 | ||||
-rw-r--r-- | marshal.c | 4 | ||||
-rw-r--r-- | version.h | 4 |
4 files changed, 23 insertions, 11 deletions
@@ -1,3 +1,11 @@ +Sun Aug 11 09:34:07 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net> + + * eval.c (rb_eval): set line number from all nodes. + + * eval.c (proc_to_s): show source file/line if available. + + * marshal.c (r_object): register TYPE_BIGNUM regardless real type. + Fri Aug 9 13:31:40 2002 WATANABE Hirofumi <eban@ruby-lang.org> * ext/Win32API/extconf.rb: check existence of <windows.h>. @@ -2209,6 +2209,7 @@ rb_eval(self, n) again: if (!node) RETURN(Qnil); + ruby_sourceline = nd_line(node); switch (nd_type(node)) { case NODE_BLOCK: while (node->nd_next) { @@ -2294,7 +2295,6 @@ rb_eval(self, n) RETURN(Qfalse); case NODE_IF: - ruby_sourceline = nd_line(node); if (trace_func) { call_trace_func("line", node->nd_file, ruby_sourceline, self, ruby_frame->last_func, @@ -2397,7 +2397,6 @@ rb_eval(self, n) result = Qnil; switch (state = EXEC_TAG()) { case 0: - ruby_sourceline = nd_line(node); if (node->nd_state && !RTEST(rb_eval(self, node->nd_cond))) goto while_out; do { @@ -2430,7 +2429,6 @@ rb_eval(self, n) result = Qnil; switch (state = EXEC_TAG()) { case 0: - ruby_sourceline = nd_line(node); if (node->nd_state && RTEST(rb_eval(self, node->nd_cond))) goto until_out; do { @@ -3075,7 +3073,6 @@ rb_eval(self, n) break; case NODE_EVSTR: - ruby_sourceline = nd_line(node); result = rb_obj_as_string(rb_eval(self, node->nd_body)); break; @@ -6622,11 +6619,20 @@ proc_to_s(self, other) { struct BLOCK *data; char *cname = rb_class2name(CLASS_OF(self)); + long len = strlen(cname)+6+16+1; /* 6:tags 16:addr 1:nul */ VALUE str; Data_Get_Struct(self, struct BLOCK, data); - str = rb_str_new(0, strlen(cname)+6+16+1); /* 6:tags 16:addr 1:nul */ - sprintf(RSTRING(str)->ptr, "#<%s:0x%p>", cname, data->tag); + if (data->body) { + len += strlen(data->body->nd_file)+16; + str = rb_str_new(0, len); + sprintf(RSTRING(str)->ptr, "#<%s:0x%p@%s:%d>", cname, data->tag, + data->body->nd_file, nd_line(data->body)); + } + else { + str = rb_str_new(0, len); + sprintf(RSTRING(str)->ptr, "#<%s:0x%p>", cname, data->tag); + } RSTRING(str)->len = strlen(RSTRING(str)->ptr); if (OBJ_TAINTED(self)) OBJ_TAINT(str); @@ -922,9 +922,7 @@ r_object(arg) #endif } v = rb_big_norm((VALUE)big); - if (TYPE(v) == T_BIGNUM) { - r_regist(v, arg); - } + r_regist(v, arg); } break; @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.7.2" -#define RUBY_RELEASE_DATE "2002-08-06" +#define RUBY_RELEASE_DATE "2002-08-11" #define RUBY_VERSION_CODE 172 -#define RUBY_RELEASE_CODE 20020806 +#define RUBY_RELEASE_CODE 20020811 |