diff options
-rw-r--r-- | parse.y | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -2908,23 +2908,23 @@ primary : literal NODE *m = NEW_ARGS_AUX(0, 0); NODE *args, *scope; - if (nd_type($2) == NODE_MASGN) { + switch (nd_type($2)) { + case NODE_MASGN: m->nd_next = node_assign($2, NEW_FOR(NEW_DVAR(id), 0, 0)); args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0)); - } - else { - if (nd_type($2) == NODE_LASGN || - nd_type($2) == NODE_DASGN || - nd_type($2) == NODE_DASGN_CURR) { - $2->nd_value = NEW_DVAR(id); - m->nd_plen = 1; - m->nd_next = $2; - args = new_args(m, 0, 0, 0, new_args_tail(0, 0, 0)); - } - else { - m->nd_next = node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id)); - args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0)); - } + break; + case NODE_LASGN: + case NODE_DASGN: + case NODE_DASGN_CURR: + $2->nd_value = NEW_DVAR(id); + m->nd_plen = 1; + m->nd_next = $2; + args = new_args(m, 0, 0, 0, new_args_tail(0, 0, 0)); + break; + default: + m->nd_next = node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id)); + args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0)); + break; } scope = NEW_NODE(NODE_SCOPE, tbl, $8, args); tbl[0] = 1; tbl[1] = id; |