summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-20 13:30:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-20 13:30:57 +0000
commitb4b3de3e7ce9ecfdaf1df75e94dd8e4f6342e34e (patch)
tree84e91e45cf3224f60a09643c2b91cbc403caf3b2 /compile.c
parent798316eac260e3cd683da2be23fef53ee64cee00 (diff)
node.c: predicates for special NODEs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index 806c86f72a..8ffaef2fdf 100644
--- a/compile.c
+++ b/compile.c
@@ -4088,7 +4088,7 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node,
const NODE *rhsn = node->nd_value;
const NODE *splatn = node->nd_args;
const NODE *lhsn = node->nd_head;
- int lhs_splat = (splatn && splatn != NODE_SPECIAL_NO_NAME_REST) ? 1 : 0;
+ int lhs_splat = (splatn && NODE_NAMED_REST_P(splatn)) ? 1 : 0;
if (!popped || splatn || !compile_massign_opt(iseq, ret, rhsn, lhsn)) {
int llen = 0;
@@ -4145,12 +4145,12 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node,
const NODE *postn = splatn->nd_2nd;
const NODE *restn = splatn->nd_1st;
int num = (int)postn->nd_alen;
- int flag = 0x02 | ((restn == NODE_SPECIAL_NO_NAME_REST) ? 0x00 : 0x01);
+ int flag = 0x02 | (NODE_NAMED_REST_P(restn) ? 0x01 : 0x00);
ADD_INSN2(ret, nd_line(splatn), expandarray,
INT2FIX(num), INT2FIX(flag));
- if (restn != NODE_SPECIAL_NO_NAME_REST) {
+ if (NODE_NAMED_REST_P(restn)) {
CHECK(compile_massign_lhs(iseq, ret, restn));
}
while (postn) {