summaryrefslogtreecommitdiff
path: root/node.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 /node.c
parentf223ab47e6e41e4a5f0307a5202b4f5c534a3596 (diff)
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 'node.c')
-rw-r--r--node.c10
1 files changed, 5 insertions, 5 deletions
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;