From 99c9431ea1cc538489c3da70f52121aa8bc0800b Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sat, 7 Sep 2019 10:42:00 +0900 Subject: 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. --- ast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ast.c') 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); -- cgit v1.2.3