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. --- node.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'node.c') diff --git a/node.c b/node.c index f4df845d2c..7cd238a37c 100644 --- a/node.c +++ b/node.c @@ -114,7 +114,7 @@ dump_array(VALUE buf, VALUE indent, int comment, const NODE *node) const char *next_indent = default_indent; F_LONG(nd_alen, "length"); F_NODE(nd_head, "element"); - 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; F_NODE(nd_head, "element"); } @@ -557,8 +557,8 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node) ANN("example: super"); return; - case NODE_ARRAY: - ANN("array constructor"); + case NODE_LIST: + ANN("list constructor"); ANN("format: [ [nd_head], [nd_next].. ] (length: [nd_alen])"); ANN("example: [1, 2, 3]"); goto ary; @@ -570,8 +570,8 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node) dump_array(buf, indent, comment, node); return; - case NODE_ZARRAY: - ANN("empty array constructor"); + case NODE_ZLIST: + ANN("empty list constructor"); ANN("format: []"); ANN("example: []"); return; -- cgit v1.2.1