diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | eval.c | 3 | ||||
-rw-r--r-- | gc.c | 1 | ||||
-rw-r--r-- | node.h | 2 | ||||
-rw-r--r-- | parse.y | 4 | ||||
-rw-r--r-- | version.c | 5 |
6 files changed, 17 insertions, 7 deletions
@@ -3,6 +3,15 @@ Thu Jan 22 16:21:02 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * parse.y (string_content): reset lexical states at the beginning of string contents. [ruby-list:39061] +Thu Jan 22 08:08:50 2004 Yukihiro Matsumoto <matz@ruby-lang.org> + + * parse.y (opt_rescue): use NODE_ERRINFO() instead of + NODE_GVAR("$!"), to avoid confusion from variable aliasing. + [ruby-talk:90074] + + * version.c (Init_version): remove obsolete constants VERSION + etc. [ruby-dev:22643] + Thu Jan 22 01:46:32 2004 Yukihiro Matsumoto <matz@ruby-lang.org> * parse.y (newline_node): do not use NODE_NEWLINE node anymore, @@ -2775,6 +2775,9 @@ rb_eval(self, n) case NODE_FALSE: RETURN(Qfalse); + case NODE_ERRINFO: + RETURN(ruby_errinfo); + case NODE_IF: if (trace_func) { call_trace_func("line", node, self, @@ -857,6 +857,7 @@ gc_mark_children(ptr, lev) case NODE_NIL: case NODE_TRUE: case NODE_FALSE: + case NODE_ERRINFO: case NODE_ATTRSET: case NODE_BLOCK_ARG: case NODE_POSTEXE: @@ -112,6 +112,7 @@ enum node_type { NODE_NIL, NODE_TRUE, NODE_FALSE, + NODE_ERRINFO, NODE_DEFINED, NODE_POSTEXE, #ifdef C_ALLOCA @@ -330,6 +331,7 @@ typedef struct RNode { #define NEW_NIL() NEW_NODE(NODE_NIL,0,0,0) #define NEW_TRUE() NEW_NODE(NODE_TRUE,0,0,0) #define NEW_FALSE() NEW_NODE(NODE_FALSE,0,0,0) +#define NEW_ERRINFO() NEW_NODE(NODE_ERRINFO,0,0,0) #define NEW_DEFINED(e) NEW_NODE(NODE_DEFINED,e,0,0) #define NEW_PREEXE(b) NEW_SCOPE(b) #define NEW_POSTEXE() NEW_NODE(NODE_POSTEXE,0,0,0) @@ -384,7 +384,7 @@ stmts : none } | stmts terms stmt { - $$ = block_append($1, $3); + $$ = block_append($1, newline_node($3)); } | error stmt { @@ -1858,7 +1858,7 @@ opt_rescue : kRESCUE exc_list exc_var then opt_rescue { if ($3) { - $3 = node_assign($3, NEW_GVAR(rb_intern("$!"))); + $3 = node_assign($3, NEW_ERRINFO()); $5 = block_append($3, $5); } $$ = NEW_RESBODY($2, $5, $6); @@ -24,11 +24,6 @@ Init_version() rb_define_global_const("RUBY_VERSION", v); rb_define_global_const("RUBY_RELEASE_DATE", d); rb_define_global_const("RUBY_PLATFORM", p); - - /* obsolete constants */ - rb_define_global_const("VERSION", v); - rb_define_global_const("RELEASE_DATE", d); - rb_define_global_const("PLATFORM", p); } void |