From 0abfa1c532bfa73eccdb5e8f05957c0935f5b1d9 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 2 Feb 2007 10:24:06 +0000 Subject: [PATCH] * parse.y (assignable_gen): no need to generate NODE_CVDECL. * compile.c (iseq_compile_each): no NODE_CVDECL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ compile.c | 5 ++--- gc.c | 1 - iseq.c | 2 -- parse.y | 4 +--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebbfa1ad9d..c484b395f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,12 @@ Fri Feb 2 18:27:54 2007 Yukihiro Matsumoto * eval.c: remove duplicated global variables rb_cProc and rb_cBinding. [ruby-dev:30242] +Thu Feb 1 21:04:39 2007 Yukihiro Matsumoto + + * parse.y (assignable_gen): no need to generate NODE_CVDECL. + + * compile.c (iseq_compile_each): no NODE_CVDECL. + Thu Feb 1 20:53:32 2007 Yukihiro Matsumoto * vm.c (eval_get_cvar_base): destination for class variable access diff --git a/compile.c b/compile.c index c46951a13d..c8ddb2f80f 100644 --- a/compile.c +++ b/compile.c @@ -3347,15 +3347,14 @@ iseq_compile_each(yarv_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) } break; } - case NODE_CVASGN: - case NODE_CVDECL:{ + case NODE_CVASGN:{ COMPILE(ret, "cvasgn val", node->nd_value); if (!poped) { ADD_INSN(ret, nd_line(node), dup); } ADD_INSN2(ret, nd_line(node), setclassvariable, ID2SYM(node->nd_vid), - nd_type(node) == NODE_CVDECL ? Qtrue : Qfalse); + Qfalse); break; } case NODE_OP_ASGN1:{ diff --git a/gc.c b/gc.c index 5106827729..6c75f011b4 100644 --- a/gc.c +++ b/gc.c @@ -896,7 +896,6 @@ gc_mark_children(VALUE ptr, int lev) case NODE_DASGN: case NODE_DASGN_CURR: case NODE_IASGN: - case NODE_CVDECL: case NODE_CVASGN: case NODE_COLON3: case NODE_OPT_N: diff --git a/iseq.c b/iseq.c index e199e49864..b765001bea 100644 --- a/iseq.c +++ b/iseq.c @@ -867,8 +867,6 @@ node_name(int node) return "NODE_CDECL"; case NODE_CVASGN: return "NODE_CVASGN"; - case NODE_CVDECL: - return "NODE_CVDECL"; case NODE_OP_ASGN1: return "NODE_OP_ASGN1"; case NODE_OP_ASGN2: diff --git a/parse.y b/parse.y index 3bdc9901dc..1d93b5cd08 100644 --- a/parse.y +++ b/parse.y @@ -7304,8 +7304,7 @@ assignable_gen(struct parser_params *parser, ID id, NODE *val) return NEW_CDECL(id, val, 0); } else if (is_class_id(id)) { - if (in_def || in_single) return NEW_CVASGN(id, val); - return NEW_CVDECL(id, val); + return NEW_CVASGN(id, val); } else { rb_compile_error("identifier %s is not valid", rb_id2name(id)); @@ -7438,7 +7437,6 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs) case NODE_DASGN_CURR: case NODE_MASGN: case NODE_CDECL: - case NODE_CVDECL: case NODE_CVASGN: lhs->nd_value = rhs; break;