aboutsummaryrefslogtreecommitdiffstats
path: root/ast.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-09-07 10:42:00 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-09-07 13:56:29 +0900
commit99c9431ea1cc538489c3da70f52121aa8bc0800b (patch)
tree564bf58b355fd9e47d954a5e10b8c395385fbeee /ast.c
parentf223ab47e6e41e4a5f0307a5202b4f5c534a3596 (diff)
downloadruby-99c9431ea1cc538489c3da70f52121aa8bc0800b.tar.gz
Rename NODE_ARRAY to NODE_LIST to reflect its actual use cases
and NODE_ZARRAY to NODE_ZLIST. NODE_ARRAY is used not only by an Array literal, but also the contents of Hash literals, method call arguments, dynamic string literals, etc. In addition, the structure of NODE_ARRAY is a linked list, not an array. This is very confusing, so I believe `NODE_LIST` is a better name.
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ast.c b/ast.c
index fdb4b7a621..7f54d859ef 100644
--- a/ast.c
+++ b/ast.c
@@ -337,7 +337,7 @@ dump_array(rb_ast_t *ast, NODE *node)
VALUE ary = rb_ary_new();
rb_ary_push(ary, NEW_CHILD(ast, node->nd_head));
- while (node->nd_next && nd_type(node->nd_next) == NODE_ARRAY) {
+ while (node->nd_next && nd_type(node->nd_next) == NODE_LIST) {
node = node->nd_next;
rb_ary_push(ary, NEW_CHILD(ast, node->nd_head));
}
@@ -491,12 +491,12 @@ node_children(rb_ast_t *ast, NODE *node)
return rb_ary_new_from_node_args(ast, 1, node->nd_args);
case NODE_ZSUPER:
return rb_ary_new_from_node_args(ast, 0);
- case NODE_ARRAY:
+ case NODE_LIST:
goto ary;
case NODE_VALUES:
ary:
return dump_array(ast, node);
- case NODE_ZARRAY:
+ case NODE_ZLIST:
return rb_ary_new_from_node_args(ast, 0);
case NODE_HASH:
return rb_ary_new_from_node_args(ast, 1, node->nd_head);