summaryrefslogtreecommitdiff
path: root/node.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 /node.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 'node.c')
-rw-r--r--node.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/node.c b/node.c
index e17067157f..d41b330b5c 100644
--- a/node.c
+++ b/node.c
@@ -342,7 +342,7 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
ANN("example: a, b = foo");
F_NODE(nd_value, "rhsn");
F_NODE(nd_head, "lhsn");
- if (node->nd_args != NODE_SPECIAL_NO_NAME_REST) {
+ if (NODE_NAMED_REST_P(node->nd_args)) {
LAST_NODE;
F_NODE(nd_args, "splatn");
}
@@ -356,7 +356,7 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
ANN("format: [nd_vid](lvar) = [nd_value]");
ANN("example: x = foo");
F_ID(nd_vid, "local variable");
- if (node->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
+ if (NODE_REQUIRED_KEYWORD_P(node)) {
F_MSG(nd_value, "rvalue", "NODE_SPECIAL_REQUIRED_KEYWORD (required keyword argument)");
}
else {
@@ -377,7 +377,7 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
ANN("format: [nd_vid](current dvar) = [nd_value]");
ANN("example: 1.times { x = foo }");
F_ID(nd_vid, "local variable");
- if (node->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
+ if (NODE_REQUIRED_KEYWORD_P(node)) {
F_MSG(nd_value, "rvalue", "NODE_SPECIAL_REQUIRED_KEYWORD (required keyword argument)");
}
else {
@@ -955,7 +955,7 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
ANN("post arguments");
ANN("format: *[nd_1st], [nd_2nd..] = ..");
ANN("example: a, *rest, z = foo");
- if (node->nd_1st != NODE_SPECIAL_NO_NAME_REST) {
+ if (NODE_NAMED_REST_P(node->nd_1st)) {
F_NODE(nd_1st, "rest argument");
}
else {