mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
node.c: Stop double meaning of NODE_FOR by introducing NODE_FOR_MASGN
NODE_FOR was used both for "for"-statement itself and for multi-assignment of for-statement (for x, y, in...end). This change separates the two purposes, NODE_FOR for the former, and newly introduced NODE_FOR_MASGN for the latter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
56524df980
commit
4b6f3bce25
6 changed files with 45 additions and 37 deletions
5
node.h
5
node.h
|
@ -42,6 +42,8 @@ enum node_type {
|
|||
#define NODE_ITER NODE_ITER
|
||||
NODE_FOR,
|
||||
#define NODE_FOR NODE_FOR
|
||||
NODE_FOR_MASGN,
|
||||
#define NODE_FOR_MASGN NODE_FOR_MASGN
|
||||
NODE_BREAK,
|
||||
#define NODE_BREAK NODE_BREAK
|
||||
NODE_NEXT,
|
||||
|
@ -382,7 +384,8 @@ typedef struct RNode {
|
|||
#define NEW_WHEN(c,t,e,loc) NEW_NODE(NODE_WHEN,c,t,e,loc)
|
||||
#define NEW_WHILE(c,b,n,loc) NEW_NODE(NODE_WHILE,c,b,n,loc)
|
||||
#define NEW_UNTIL(c,b,n,loc) NEW_NODE(NODE_UNTIL,c,b,n,loc)
|
||||
#define NEW_FOR(v,i,b,loc) NEW_NODE(NODE_FOR,v,b,i,loc)
|
||||
#define NEW_FOR(i,b,loc) NEW_NODE(NODE_FOR,0,b,i,loc)
|
||||
#define NEW_FOR_MASGN(v,loc) NEW_NODE(NODE_FOR_MASGN,v,0,0,loc)
|
||||
#define NEW_ITER(a,b,loc) NEW_NODE(NODE_ITER,0,NEW_SCOPE(a,b,loc),0,loc)
|
||||
#define NEW_LAMBDA(a,b,loc) NEW_NODE(NODE_LAMBDA,0,NEW_SCOPE(a,b,loc),0,loc)
|
||||
#define NEW_BREAK(s,loc) NEW_NODE(NODE_BREAK,s,0,0,loc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue