mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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.
This commit is contained in:
parent
f223ab47e6
commit
99c9431ea1
7 changed files with 63 additions and 64 deletions
9
node.h
9
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue