mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: Remove almost all *_gen macros by passing parser_params explicitly
In parse.y many functions were suffixed "_gen" and had companion macros to pass struct parser_params implicitly, which made parse.c bigger and more obscure. This change expands and removes almost all "*_gen" macros. This requires explicit passing of struct parser_params, i.e., we need to write "foo(p, ..)" instead of "foo(..)". However, it is just extra three letters. I believe that this is easier to understand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
97b9899924
commit
15352965c2
2 changed files with 624 additions and 706 deletions
2
node.h
2
node.h
|
@ -373,7 +373,7 @@ typedef struct RNode {
|
|||
|
||||
#define NEW_DEFN(i,a,d,loc) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d,loc),loc)
|
||||
#define NEW_DEFS(r,i,a,d,loc) NEW_NODE(NODE_DEFS,r,i,NEW_SCOPE(a,d,loc),loc)
|
||||
#define NEW_SCOPE(a,b,loc) NEW_NODE(NODE_SCOPE,local_tbl(),b,a,loc)
|
||||
#define NEW_SCOPE(a,b,loc) NEW_NODE(NODE_SCOPE,local_tbl(p),b,a,loc)
|
||||
#define NEW_BLOCK(a,loc) NEW_NODE(NODE_BLOCK,a,0,0,loc)
|
||||
#define NEW_IF(c,t,e,loc) NEW_NODE(NODE_IF,c,t,e,loc)
|
||||
#define NEW_UNLESS(c,t,e,loc) NEW_NODE(NODE_UNLESS,c,t,e,loc)
|
||||
|
|
Loading…
Add table
Reference in a new issue