summaryrefslogtreecommitdiff
path: root/node.h
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.h
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.h')
-rw-r--r--node.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/node.h b/node.h
index dbc3162512..22d10a2d58 100644
--- a/node.h
+++ b/node.h
@@ -64,8 +64,8 @@ enum node_type {
NODE_QCALL,
NODE_SUPER,
NODE_ZSUPER,
- NODE_ARRAY,
- NODE_ZARRAY,
+ NODE_LIST,
+ NODE_ZLIST,
NODE_VALUES,
NODE_HASH,
NODE_RETURN,
@@ -309,9 +309,8 @@ typedef struct RNode {
#define NEW_ENSURE(b,en,loc) NEW_NODE(NODE_ENSURE,b,0,en,loc)
#define NEW_RETURN(s,loc) NEW_NODE(NODE_RETURN,s,0,0,loc)
#define NEW_YIELD(a,loc) NEW_NODE(NODE_YIELD,a,0,0,loc)
-#define NEW_LIST(a,loc) NEW_ARRAY(a,loc)
-#define NEW_ARRAY(a,loc) NEW_NODE(NODE_ARRAY,a,1,0,loc)
-#define NEW_ZARRAY(loc) NEW_NODE(NODE_ZARRAY,0,0,0,loc)
+#define NEW_LIST(a,loc) NEW_NODE(NODE_LIST,a,1,0,loc)
+#define NEW_ZLIST(loc) NEW_NODE(NODE_ZLIST,0,0,0,loc)
#define NEW_HASH(a,loc) NEW_NODE(NODE_HASH,a,0,0,loc)
#define NEW_MASGN(l,r,loc) NEW_NODE(NODE_MASGN,l,0,r,loc)
#define NEW_GASGN(v,val,loc) NEW_NODE(NODE_GASGN,v,val,rb_global_entry(v),loc)