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

* 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]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-01-22 08:31:33 +00:00
parent 48b24fe536
commit 225cd9f109
6 changed files with 17 additions and 7 deletions

View file

@ -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,

3
eval.c
View file

@ -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,

1
gc.c
View file

@ -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:

2
node.h
View file

@ -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)

View file

@ -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);

View file

@ -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