* parse.y (stmt): rhs of multiple assignment should not be

expanded using "to_a". [ruby-dev:21527]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-10-06 17:59:53 +00:00
Родитель 0dd4fde745
Коммит 8a4abe47ca
5 изменённых файлов: 44 добавлений и 35 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Oct 7 02:57:53 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (stmt): rhs of multiple assignment should not be
expanded using "to_a". [ruby-dev:21527]
Tue Oct 7 01:42:34 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_asn1.c (ossl_asn1_get_asn1type): use appropriate

67
eval.c
Просмотреть файл

@ -2774,6 +2774,10 @@ rb_eval(self, n)
result = splat_value(rb_eval(self, node->nd_head));
break;
case NODE_TO_ARY:
result = rb_ary_to_ary(rb_eval(self, node->nd_head));
break;
case NODE_SVALUE:
result = avalue_splat(rb_eval(self, node->nd_head));
if (result == Qundef) result = Qnil;
@ -6483,45 +6487,42 @@ rb_f_at_exit()
void
rb_exec_end_proc()
{
struct end_proc_data *link, *save;
struct end_proc_data *link, *tmp;
int status;
save = link = end_procs;
while (link) {
PUSH_TAG(PROT_NONE);
if ((status = EXEC_TAG()) == 0) {
(*link->func)(link->data);
}
POP_TAG();
if (status) {
error_handle(status);
}
link = link->next;
}
link = end_procs;
while (link != save) {
PUSH_TAG(PROT_NONE);
if ((status = EXEC_TAG()) == 0) {
(*link->func)(link->data);
}
POP_TAG();
if (status) {
error_handle(status);
}
link = link->next;
}
while (ephemeral_end_procs) {
link = ephemeral_end_procs;
ephemeral_end_procs = link->next;
PUSH_TAG(PROT_NONE);
if ((status = EXEC_TAG()) == 0) {
(*link->func)(link->data);
ephemeral_end_procs = 0;
while (link) {
PUSH_TAG(PROT_NONE);
if ((status = EXEC_TAG()) == 0) {
(*link->func)(link->data);
}
POP_TAG();
if (status) {
error_handle(status);
}
tmp = link;
link = link->next;
free(tmp);
}
POP_TAG();
if (status) {
error_handle(status);
}
while (end_procs) {
link = end_procs;
end_procs = 0;
while (link) {
PUSH_TAG(PROT_NONE);
if ((status = EXEC_TAG()) == 0) {
(*link->func)(link->data);
}
POP_TAG();
if (status) {
error_handle(status);
}
tmp = link;
link = link->next;
free(tmp);
}
free(link);
}
}

1
gc.c
Просмотреть файл

@ -755,6 +755,7 @@ rb_gc_mark_children(ptr)
case NODE_COLON2:
case NODE_ARGS:
case NODE_SPLAT:
case NODE_TO_ARY:
case NODE_SVALUE:
ptr = (VALUE)obj->as.node.u1.node;
goto again;

2
node.h
Просмотреть файл

@ -88,6 +88,7 @@ enum node_type {
NODE_ARGSCAT,
NODE_ARGSPUSH,
NODE_SPLAT,
NODE_TO_ARY,
NODE_SVALUE,
NODE_BLOCK_ARG,
NODE_BLOCK_PASS,
@ -308,6 +309,7 @@ typedef struct RNode {
#define NEW_ARGSCAT(a,b) NEW_NODE(NODE_ARGSCAT,a,b,0)
#define NEW_ARGSPUSH(a,b) NEW_NODE(NODE_ARGSPUSH,a,b,0)
#define NEW_SPLAT(a) NEW_NODE(NODE_SPLAT,a,0,0)
#define NEW_TO_ARY(a) NEW_NODE(NODE_TO_ARY,a,0,0)
#define NEW_SVALUE(a) NEW_NODE(NODE_SVALUE,a,0,0)
#define NEW_BLOCK_ARG(v) NEW_NODE(NODE_BLOCK_ARG,v,0,local_cnt(v))
#define NEW_BLOCK_PASS(b) NEW_NODE(NODE_BLOCK_PASS,0,b,0)

Просмотреть файл

@ -486,7 +486,7 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
| mlhs '=' command_call
{
value_expr($3);
$1->nd_value = ($1->nd_head) ? NEW_SPLAT($3) : NEW_ARRAY($3);
$1->nd_value = NEW_TO_ARY($3);
$$ = $1;
}
| var_lhs tOP_ASGN command_call
@ -578,7 +578,7 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
}
| mlhs '=' arg_value
{
$1->nd_value = ($1->nd_head) ? NEW_SPLAT($3) : NEW_ARRAY($3);
$1->nd_value = NEW_TO_ARY($3);
$$ = $1;
}
| mlhs '=' mrhs