summaryrefslogtreecommitdiff
path: root/ext/-test-
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 /ext/-test-
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 'ext/-test-')
-rw-r--r--ext/-test-/ast/ast.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/-test-/ast/ast.c b/ext/-test-/ast/ast.c
index eab1cfb..b5be606 100644
--- a/ext/-test-/ast/ast.c
+++ b/ext/-test-/ast/ast.c
@@ -239,7 +239,7 @@ node_children(rb_ast_t *ast, NODE *node)
return ary;
}
case NODE_MASGN:
- if (node->nd_args != NODE_SPECIAL_NO_NAME_REST) {
+ if (NODE_NAMED_REST_P(node->nd_args)) {
return rb_ary_new_from_node_args(ast, 3, node->nd_value, node->nd_head, node->nd_args);
}
return rb_ary_new_from_node_args(ast, 2, node->nd_value, node->nd_head);
@@ -253,7 +253,7 @@ node_children(rb_ast_t *ast, NODE *node)
goto asgn;
case NODE_CVASGN:
asgn:
- if (node->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
+ if (NODE_REQUIRED_KEYWORD_P(node)) {
return rb_ary_new_from_node_args(ast, 0);
}
return rb_ary_new_from_node_args(ast, 1, node->nd_value);
@@ -404,7 +404,7 @@ node_children(rb_ast_t *ast, NODE *node)
case NODE_KW_ARG:
return rb_ary_new_from_node_args(ast, 2, node->nd_body, node->nd_next);
case NODE_POSTARG:
- if (node->nd_1st != NODE_SPECIAL_NO_NAME_REST) {
+ if (NODE_NAMED_REST_P(node->nd_1st)) {
return rb_ary_new_from_node_args(ast, 2, node->nd_1st, node->nd_2nd);
}
return rb_ary_new_from_node_args(ast, 1, node->nd_2nd);