[前][次][番号順一覧][スレッド一覧]

ruby-changes:49552

From: mame <ko1@a...>
Date: Mon, 8 Jan 2018 11:19:53 +0900 (JST)
Subject: [ruby-changes:49552] mame:r61668 (trunk): parse.y: Remove unneeded wrapper functions for NEW_NODEs

mame	2018-01-08 11:19:47 +0900 (Mon, 08 Jan 2018)

  New Revision: 61668

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61668

  Log:
    parse.y: Remove unneeded wrapper functions for NEW_NODEs
    
    Just refactoring.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61667)
+++ parse.y	(revision 61668)
@@ -399,8 +399,7 @@ set_line_body(NODE *body, int line) https://github.com/ruby/ruby/blob/trunk/parse.y#L399
 static NODE *cond_gen(struct parser_params*,NODE*,int,const YYLTYPE*);
 #define cond(node,location) cond_gen(parser, (node), FALSE, location)
 #define method_cond(node,location) cond_gen(parser, (node), TRUE, location)
-static NODE *new_nil_gen(struct parser_params*,const YYLTYPE*);
-#define new_nil(location) new_nil_gen(parser,location)
+#define new_nil(location) NEW_NIL(location)
 static NODE *new_if_gen(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
 #define new_if(cc,left,right,location) new_if_gen(parser, (cc), (left), (right), (location))
 static NODE *new_unless_gen(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
@@ -503,7 +502,7 @@ static NODE *const_decl_gen(struct parse https://github.com/ruby/ruby/blob/trunk/parse.y#L502
 #define const_decl(path, location) const_decl_gen(parser, path, location)
 
 #define var_field(n) (n)
-#define backref_assign_error(n, a, location) (rb_backref_error(n), new_begin(0, location))
+#define backref_assign_error(n, a, location) (rb_backref_error(n), NEW_BEGIN(0, location))
 
 static NODE *opt_arg_append(NODE*, NODE*);
 static NODE *kwd_append(NODE*, NODE*);
@@ -520,66 +519,13 @@ static NODE *new_regexp_gen(struct parse https://github.com/ruby/ruby/blob/trunk/parse.y#L519
 static NODE *new_lit_gen(struct parser_params *parser, VALUE sym, const YYLTYPE *location);
 #define new_lit(sym, location) new_lit_gen(parser, sym, location)
 
-static NODE *new_list_gen(struct parser_params *parser, NODE *item, const YYLTYPE *location);
-#define new_list(item, location) new_list_gen(parser, item, location)
-
 static NODE *new_str_gen(struct parser_params *parser, VALUE str, const YYLTYPE *location);
 #define new_str(s,location) new_str_gen(parser, s, location)
 
-static NODE *new_dvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
-#define new_dvar(id, location) new_dvar_gen(parser, id, location)
-
-static NODE *new_resbody_gen(struct parser_params *parser, NODE *exc_list, NODE *stmt, NODE *rescue, const YYLTYPE *location);
-#define new_resbody(e,s,r,location) new_resbody_gen(parser, (e),(s),(r),(location))
-
-static NODE *new_errinfo_gen(struct parser_params *parser, const YYLTYPE *location);
-#define new_errinfo(location) new_errinfo_gen(parser, location)
-
-static NODE *new_call_gen(struct parser_params *parser, NODE *recv, ID mid, NODE *args, const YYLTYPE *location);
-#define new_call(recv,mid,args,location) new_call_gen(parser, recv,mid,args,location)
-
-static NODE *new_fcall_gen(struct parser_params *parser, ID mid, NODE *args, const YYLTYPE *location);
-#define new_fcall(mid,args,location) new_fcall_gen(parser, mid, args, location)
-
-static NODE *new_for_gen(struct parser_params *parser, NODE *var, NODE *iter, NODE *body, const YYLTYPE *location);
-#define new_for(var,iter,body,location) new_for_gen(parser, var, iter, body, location)
-
-static NODE *new_gvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
-#define new_gvar(id, location) new_gvar_gen(parser, id, location)
-
-static NODE *new_lvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
-#define new_lvar(id, location) new_lvar_gen(parser, id, location)
-
 static NODE *new_dstr_gen(struct parser_params *parser, VALUE str, const YYLTYPE *location);
 #define new_dstr(s, location) new_dstr_gen(parser, s, location)
 
-static NODE *new_rescue_gen(struct parser_params *parser, NODE *b, NODE *res, NODE *e, const YYLTYPE *location);
-#define new_rescue(b,res,e,location) new_rescue_gen(parser,b,res,e,location)
-
-static NODE *new_undef_gen(struct parser_params *parser, NODE *i, const YYLTYPE *location);
-#define new_undef(i, location) new_undef_gen(parser, i, location)
-
-static NODE *new_zarray_gen(struct parser_params *parser, const YYLTYPE *location);
-#define new_zarray(location) new_zarray_gen(parser, location)
-#define make_array(ary, location) ((ary) ? (nd_set_loc(ary, location), ary) : new_zarray(location))
-
-static NODE *new_ivar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
-#define new_ivar(id, location) new_ivar_gen(parser,id,location)
-
-static NODE *new_postarg_gen(struct parser_params *parser, NODE *i, NODE *v, const YYLTYPE *location);
-#define new_postarg(i,v,location) new_postarg_gen(parser,i,v,location)
-
-static NODE *new_cdecl_gen(struct parser_params *parser, ID v, NODE *val, NODE *path, const YYLTYPE *location);
-#define new_cdecl(v,val,path,location) new_cdecl_gen(parser,v,val,path,location)
-
-static NODE *new_scope_gen(struct parser_params *parser, NODE *a, NODE *b, const YYLTYPE *location);
-#define new_scope(a,b,location) new_scope_gen(parser,a,b,location)
-
-static NODE *new_begin_gen(struct parser_params *parser, NODE *b, const YYLTYPE *location);
-#define new_begin(b,location) new_begin_gen(parser,b,location)
-
-static NODE *new_masgn_gen(struct parser_params *parser, NODE *l, NODE *r, const YYLTYPE *location);
-#define new_masgn(l,r,location) new_masgn_gen(parser,l,r,location)
+#define make_array(ary, location) ((ary) ? (nd_set_loc(ary, location), ary) : NEW_ZARRAY(location))
 
 static NODE *new_xstring_gen(struct parser_params *, NODE *, const YYLTYPE *location);
 #define new_xstring(node, location) new_xstring_gen(parser, node, location)
@@ -1187,7 +1133,7 @@ program		:  { https://github.com/ruby/ruby/blob/trunk/parse.y#L1133
 				void_expr(node->nd_head);
 			    }
 			}
-			ruby_eval_tree = new_scope(0, block_append(ruby_eval_tree, $2, &@$), &@$);
+			ruby_eval_tree = NEW_SCOPE(0, block_append(ruby_eval_tree, $2, &@$), &@$);
 		    /*%
 			$$ = $2;
 			parser->result = dispatch1(program, $$);
@@ -1209,7 +1155,7 @@ top_compstmt	: top_stmts opt_terms https://github.com/ruby/ruby/blob/trunk/parse.y#L1155
 top_stmts	: none
                     {
 		    /*%%%*/
-			$$ = new_begin(0, &@$);
+			$$ = NEW_BEGIN(0, &@$);
 		    /*%
 			$$ = dispatch2(stmts_add, dispatch0(stmts_new),
 						  dispatch0(void_stmt));
@@ -1249,10 +1195,10 @@ top_stmt	: stmt https://github.com/ruby/ruby/blob/trunk/parse.y#L1195
 		    {
 		    /*%%%*/
 			ruby_eval_tree_begin = block_append(ruby_eval_tree_begin,
-							    new_begin($4, &@$), &@$);
+							    NEW_BEGIN($4, &@$), &@$);
 			/* NEW_PREEXE($4)); */
 			/* local_pop(); */
-			$$ = new_begin(0, &@$);
+			$$ = NEW_BEGIN(0, &@$);
 		    /*%
 			$$ = dispatch1(BEGIN, $4);
 		    %*/
@@ -1267,7 +1213,7 @@ bodystmt	: compstmt https://github.com/ruby/ruby/blob/trunk/parse.y#L1213
 		    /*%%%*/
 			$$ = $1;
 			if ($2) {
-			    $$ = new_rescue($1, $2, $3, &@$);
+			    $$ = NEW_RESCUE($1, $2, $3, &@$);
 			}
 			else if ($3) {
 			    rb_warn0("else without rescue is useless");
@@ -1306,7 +1252,7 @@ compstmt	: stmts opt_terms https://github.com/ruby/ruby/blob/trunk/parse.y#L1252
 stmts		: none
                     {
 		    /*%%%*/
-			$$ = new_begin(0, &@$);
+			$$ = NEW_BEGIN(0, &@$);
 		    /*%
 			$$ = dispatch2(stmts_add, dispatch0(stmts_new),
 						  dispatch0(void_stmt));
@@ -1353,7 +1299,7 @@ stmt_or_begin	: stmt https://github.com/ruby/ruby/blob/trunk/parse.y#L1299
 							    $4, &@$);
 			/* NEW_PREEXE($4)); */
 			/* local_pop(); */
-			$$ = new_begin(0, &@$);
+			$$ = NEW_BEGIN(0, &@$);
 		    /*%
 			$$ = dispatch1(BEGIN, $4);
 		    %*/
@@ -1391,7 +1337,7 @@ stmt		: keyword_alias fitem {SET_LEX_STA https://github.com/ruby/ruby/blob/trunk/parse.y#L1337
 		    {
 		    /*%%%*/
 			yyerror1(&@3, "can't make alias for the number variables");
-			$$ = new_begin(0, &@$);
+			$$ = NEW_BEGIN(0, &@$);
 		    /*%
 			$$ = dispatch2(var_alias, $2, $3);
 			$$ = dispatch1(alias_error, $$);
@@ -1457,8 +1403,8 @@ stmt		: keyword_alias fitem {SET_LEX_STA https://github.com/ruby/ruby/blob/trunk/parse.y#L1403
 			YYLTYPE location;
 			location.first_loc = @2.first_loc;
 			location.last_loc = @3.last_loc;
-			resq = new_resbody(0, remove_begin($3), 0, &location);
-			$$ = new_rescue(remove_begin($1), resq, 0, &@$);
+			resq = NEW_RESBODY(0, remove_begin($3), 0, &location);
+			$$ = NEW_RESCUE(remove_begin($1), resq, 0, &@$);
 		    /*%
 			$$ = dispatch2(rescue_mod, $1, $3);
 		    %*/
@@ -1583,7 +1529,7 @@ command_rhs	: command_call   %prec tOP_A https://github.com/ruby/ruby/blob/trunk/parse.y#L1529
 			location.first_loc = @2.first_loc;
 			location.last_loc = @3.last_loc;
 			value_expr($1);
-			$$ = new_rescue($1, new_resbody(0, remove_begin($3), 0, &location), 0, &@$);
+			$$ = NEW_RESCUE($1, NEW_RESBODY(0, remove_begin($3), 0, &location), 0, &@$);
 		    /*%
 			$$ = dispatch2(rescue_mod, $1, $3);
 		    %*/
@@ -1655,7 +1601,7 @@ cmd_brace_block	: tLBRACE_ARG https://github.com/ruby/ruby/blob/trunk/parse.y#L1601
 fcall		: operation
 		    {
 		    /*%%%*/
-			$$ = new_fcall($1, 0, &@$);
+			$$ = NEW_FCALL($1, 0, &@$);
 			nd_set_line($$, tokline);
 		    /*%
 		    %*/
@@ -1766,7 +1712,7 @@ mlhs_inner	: mlhs_basic https://github.com/ruby/ruby/blob/trunk/parse.y#L1712
 		| tLPAREN mlhs_inner rparen
 		    {
 		    /*%%%*/
-			$$ = new_masgn(new_list($2, &@$), 0, &@$);
+			$$ = NEW_MASGN(NEW_LIST($2, &@$), 0, &@$);
 		    /*%
 			$$ = dispatch1(mlhs_paren, $2);
 		    %*/
@@ -1776,7 +1722,7 @@ mlhs_inner	: mlhs_basic https://github.com/ruby/ruby/blob/trunk/parse.y#L1722
 mlhs_basic	: mlhs_head
 		    {
 		    /*%%%*/
-			$$ = new_masgn($1, 0, &@$);
+			$$ = NEW_MASGN($1, 0, &@$);
 		    /*%
 			$$ = $1;
 		    %*/
@@ -1784,7 +1730,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1730
 		| mlhs_head mlhs_item
 		    {
 		    /*%%%*/
-			$$ = new_masgn(list_append($1,$2), 0, &@$);
+			$$ = NEW_MASGN(list_append($1,$2), 0, &@$);
 		    /*%
 			$$ = mlhs_add($1, $2);
 		    %*/
@@ -1792,7 +1738,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1738
 		| mlhs_head tSTAR mlhs_node
 		    {
 		    /*%%%*/
-			$$ = new_masgn($1, $3, &@$);
+			$$ = NEW_MASGN($1, $3, &@$);
 		    /*%
 			$$ = mlhs_add_star($1, $3);
 		    %*/
@@ -1800,7 +1746,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1746
 		| mlhs_head tSTAR mlhs_node ',' mlhs_post
 		    {
 		    /*%%%*/
-			$$ = new_masgn($1, new_postarg($3,$5,&@$), &@$);
+			$$ = NEW_MASGN($1, NEW_POSTARG($3,$5,&@$), &@$);
 		    /*%
 			$1 = mlhs_add_star($1, $3);
 			$$ = mlhs_add_post($1, $5);
@@ -1809,7 +1755,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1755
 		| mlhs_head tSTAR
 		    {
 		    /*%%%*/
-			$$ = new_masgn($1, NODE_SPECIAL_NO_NAME_REST, &@$);
+			$$ = NEW_MASGN($1, NODE_SPECIAL_NO_NAME_REST, &@$);
 		    /*%
 			$$ = mlhs_add_star($1, Qnil);
 		    %*/
@@ -1817,7 +1763,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1763
 		| mlhs_head tSTAR ',' mlhs_post
 		    {
 		    /*%%%*/
-			$$ = new_masgn($1, new_postarg(NODE_SPECIAL_NO_NAME_REST, $4, &@$), &@$);
+			$$ = NEW_MASGN($1, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, $4, &@$), &@$);
 		    /*%
 			$1 = mlhs_add_star($1, Qnil);
 			$$ = mlhs_add_post($1, $4);
@@ -1826,7 +1772,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1772
 		| tSTAR mlhs_node
 		    {
 		    /*%%%*/
-			$$ = new_masgn(0, $2, &@$);
+			$$ = NEW_MASGN(0, $2, &@$);
 		    /*%
 			$$ = mlhs_add_star(mlhs_new(), $2);
 		    %*/
@@ -1834,7 +1780,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1780
 		| tSTAR mlhs_node ',' mlhs_post
 		    {
 		    /*%%%*/
-			$$ = new_masgn(0, new_postarg($2,$4,&@$), &@$);
+			$$ = NEW_MASGN(0, NEW_POSTARG($2,$4,&@$), &@$);
 		    /*%
 			$2 = mlhs_add_star(mlhs_new(), $2);
 			$$ = mlhs_add_post($2, $4);
@@ -1843,7 +1789,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1789
 		| tSTAR
 		    {
 		    /*%%%*/
-			$$ = new_masgn(0, NODE_SPECIAL_NO_NAME_REST, &@$);
+			$$ = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &@$);
 		    /*%
 			$$ = mlhs_add_star(mlhs_new(), Qnil);
 		    %*/
@@ -1851,7 +1797,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1797
 		| tSTAR ',' mlhs_post
 		    {
 		    /*%%%*/
-			$$ = new_masgn(0, new_postarg(NODE_SPECIAL_NO_NAME_REST, $3, &@$), &@$);
+			$$ = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, $3, &@$), &@$);
 		    /*%
 			$$ = mlhs_add_star(mlhs_new(), Qnil);
 			$$ = mlhs_add_post($$, $3);
@@ -1873,7 +1819,7 @@ mlhs_item	: mlhs_node https://github.com/ruby/ruby/blob/trunk/parse.y#L1819
 mlhs_head	: mlhs_item ','
 		    {
 		    /*%%%*/
-			$$ = new_list($1, &@1);
+			$$ = NEW_LIST($1, &@1);
 		    /*%
 			$$ = mlhs_add(mlhs_new(), $1);
 		    %*/
@@ -1891,7 +1837,7 @@ mlhs_head	: mlhs_item ',' https://github.com/ruby/ruby/blob/trunk/parse.y#L1837
 mlhs_post	: mlhs_item
 		    {
 		    /*%%%*/
-			$$ = new_list($1, &@$);
+			$$ = NEW_LIST($1, &@$);
 		    /*%
 			$$ = mlhs_add(mlhs_new(), $1);
 		    %*/
@@ -2087,7 +2033,7 @@ fitem		: fsym https://github.com/ruby/ruby/blob/trunk/parse.y#L2033
 undef_list	: fitem
 		    {
 		    /*%%%*/
-			$$ = new_undef($1, &@$);
+			$$ = NEW_UNDEF($1, &@$);
 		    /*%
 			$$ = rb_ary_new3(1, get_value($1));
 		    %*/
@@ -2095,7 +2041,7 @@ undef_list	: fitem https://github.com/ruby/ruby/blob/trunk/parse.y#L2041
 		| undef_list ',' {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
 		    {
 		    /*%%%*/
-			NODE *undef = new_undef($4, &@$);
+			NODE *undef = NEW_UNDEF($4, &@$);
 			$$ = block_append($1, undef, &@$);
 		    /*%
 			rb_ary_push($1, get_value($4));
@@ -2402,7 +2348,7 @@ aref_args	: none https://github.com/ruby/ruby/blob/trunk/parse.y#L2348
 		| assocs trailer
 		    {
 		    /*%%%*/
-			$$ = $1 ? new_list(new_hash($1, &@1), &@$) : 0;
+			$$ = $1 ? NEW_LIST(new_hash($1, &@1), &@$) : 0;
 		    /*%
 			$$ = arg_add_assocs(arg_new(), $1);
 		    %*/
@@ -2424,7 +2370,7 @@ arg_rhs 	: arg   %prec tOP_ASGN https://github.com/ruby/ruby/blob/trunk/parse.y#L2370
 			location.first_loc = @2.first_loc;
 			location.last_loc = @3.last_loc;
 			value_expr($1);
-			$$ = new_rescue($1, new_resbody(0, remove_begin($3), 0, &location), 0, &@$);
+			$$ = NEW_RESCUE($1, NEW_RESBODY(0, remove_begin($3), 0, &location), 0, &@$);
 		    /*%
 			$$ = dispatch2(rescue_mod, $1, $3);
 		    %*/
@@ -2462,7 +2408,7 @@ opt_call_args	: none https://github.com/ruby/ruby/blob/trunk/parse.y#L2408
 		| assocs ','
 		    {
 		    /*%%%*/
-			$$ = $1 ? new_list(new_hash($1, &@1), &@1) : 0;
+			$$ = $1 ? NEW_LIST(new_hash($1, &@1), &@1) : 0;
 		    /*%
 			$$ = arg_add_assocs(arg_new(), $1);
 		    %*/
@@ -2473,7 +2419,7 @@ call_args	: command https://github.com/ruby/ruby/blob/trunk/parse.y#L2419
 		    {
 		    /*%%%*/
 			value_expr($1);
-			$$ = new_list($1, &@$);
+			$$ = NEW_LIST($1, &@$);
 		    /*%
 			$$ = arg_add(arg_new(), $1);
 		    %*/
@@ -2489,7 +2435,7 @@ call_args	: command https://github.com/ruby/ruby/blob/trunk/parse.y#L2435
 		| assocs opt_block_arg
 		    {
 		    /*%%%*/
-			$$ = $1 ? new_list(new_hash($1, &@1), &@1) : 0;
+			$$ = $1 ? NEW_LIST(new_hash($1, &@1), &@1) : 0;
 			$$ = arg_blk_pass($$, $2);
 		    /*%
 			$$ = arg_add_assocs(arg_new(), $1);
@@ -2549,7 +2495,7 @@ opt_block_arg	: ',' block_arg https://github.com/ruby/ruby/blob/trunk/parse.y#L2495
 args		: arg_value
 		    {
 		    /*%%%*/
-			$$ = new_list($1, &@$);
+			$$ = NEW_LIST($1, &@$);
 		    /*%
 			$$ = arg_add(arg_new(), $1);
 		    %*/
@@ -2648,7 +2594,7 @@ primary		: literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2594
 		| tFID
 		    {
 		    /*%%%*/
-			$$ = new_fcall($1, 0, &@$);
+			$$ = NEW_FCALL($1, 0, &@$);
 		    /*%
 			$$ = method_arg(dispatch1(fcall, $1), arg_new());
 		    %*/
@@ -2672,7 +2618,7 @@ primary		: literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2618
 			}
 			else {
 			    set_line_body($3, $<num>2);
-			    $$ = new_begin($3, &@$);
+			    $$ = NEW_BEGIN($3, &@$);
 			}
 			nd_set_line($$, $<num>2);
 		    /*%
@@ -2682,7 +2628,7 @@ primary		: literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2628
 		| tLPAREN_ARG {SET_LEX_STATE(EXPR_ENDARG);} rparen
 		    {
 		    /*%%%*/
-			$$ = new_begin(0, &@$);
+			$$ = NEW_BEGIN(0, &@$);
 		    /*%
 			$$ = dispatch1(paren, 0);
 		    %*/
@@ -2901,21 +2847,21 @@ primary		: literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2847
 
 			switch (nd_type($2)) {
 			  case NODE_MASGN:
-			    m->nd_next = node_assign($2, new_for(new_dvar(id, &@2), 0, 0, &@2), &@2);
+			    m->nd_next = node_assign($2, NEW_FOR(NEW_DVAR(id, &@2), 0, 0, &@2), &@2);
 			    args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0, &@2), &@2);
 			    break;
 			  case NODE_LASGN:
 			  case NODE_DASGN:
 			  case NODE_DASGN_CURR:
-			    $2->nd_value = new_dvar(id, &@2);
+			    $2->nd_value = NEW_DVAR(id, &@2);
 			    m->nd_plen = 1;
 			    m->nd_next = $2;
 			    args = new_args(m, 0, 0, 0, new_args_tail(0, 0, 0, &@2), &@2);
 			    break;
 			  default:
 			    {
-				NODE *masgn = new_masgn(new_list($2, &@2), 0, &@2);
-				m->nd_next = node_assign(masgn, new_dvar(id, &@2), &@2);
+				NODE *masgn = NEW_MASGN(NEW_LIST($2, &@2), 0, &@2);
+				m->nd_next = node_assign(masgn, NEW_DVAR(id, &@2), &@2);
 				args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0, &@2), &@2);
 				break;
 			    }
@@ -2923,7 +2869,7 @@ primary		: literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2869
 			add_mark_object((VALUE)rb_imemo_alloc_new((VALUE)tbl, 0, 0, 0));
 			scope = NEW_NODE(NODE_SCOPE, tbl, $8, args, &@$);
 			tbl[0] = 1; tbl[1] = id;
-			$$ = new_for(0, $5, scope, &@$);
+			$$ = NEW_FOR(0, $5, scope, &@$);
 			fixpos($$, $2);
 		    /*%
 			$$ = dispatch3(for, $2, $5, $8);
@@ -3264,7 +3210,7 @@ f_marg		: f_norm_arg https://github.com/ruby/ruby/blob/trunk/parse.y#L3210
 f_marg_list	: f_marg
 		    {
 		    /*%%%*/
-			$$ = new_list($1, &@$);
+			$$ = NEW_LIST($1, &@$);
 		    /*%
 			$$ = mlhs_add(mlhs_new(), $1);
 		    %*/
@@ -3282,7 +3228,7 @@ f_marg_list	: f_marg https://github.com/ruby/ruby/blob/trunk/parse.y#L3228
 f_margs		: f_marg_list
 		    {
 		    /*%%%*/
-			$$ = new_masgn($1, 0, &@$);
+			$$ = NEW_MASGN($1, 0, &@$);
 		    /*%
 			$$ = $1;
 		    %*/
@@ -3291,7 +3237,7 @@ f_margs		: f_marg_list https://github.com/ruby/ruby/blob/trunk/parse.y#L3237
 		    {
 			$$ = assignable($4, 0, &@$);
 		    /*%%%*/
-			$$ = new_masgn($1, $$, &@$);
+			$$ = NEW_MASGN($1, $$, &@$);
 		    /*%
 			$$ = mlhs_add_star($1, $$);
 		    %*/
@@ -3300,7 +3246,7 @@ f_margs		: f_marg_list https://github.com/ruby/ruby/blob/trunk/parse.y#L3246
 		    {
 			$$ = assignable($4, 0, &@$);
 		    /*%%%*/
-			$$ = new_masgn($1, new_postarg($$, $6, &@$), &@$);
+			$$ = NEW_MASGN($1, NEW_POSTARG($$, $6, &@$), &@$);
 		    /*%
 			$$ = mlhs_add_star($1, $$);
 			$$ = mlhs_add_post($$, $6);
@@ -3309,7 +3255,7 @@ f_margs		: f_marg_list https://github.com/ruby/ruby/blob/trunk/parse.y#L3255
 		| f_marg_list ',' tSTAR
 		    {
 		    /*%%%*/
-			$$ = new_masgn($1, NODE_SPECIAL_NO_NAME_REST, &@$);
+			$$ = NEW_MASGN($1, NODE_SPECIAL_NO_NAME_REST, &@$);
 		    /*%
 			$$ = mlhs_add_star($1, Qnil);
 		    %*/
@@ -3317,7 +3263,7 @@ f_margs		: f_marg_list https://github.com/ruby/ruby/blob/trunk/parse.y#L3263
 		| f_marg_list ',' tSTAR ',' f_marg_list
 		    {
 		    /*%%%*/
-			$$ = new_masgn($1, new_postarg(NODE_SPECIAL_NO_NAME_REST, $5, &@$), &@$);
+			$$ = NEW_MASGN($1, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, $5, &@$), &@$);
 		    /*%
 			$$ = mlhs_add_star($1, Qnil);
 			$$ = mlhs_add_post($$, $5);
@@ -3327,7 +3273,7 @@ f_margs		: f_marg_list https://github.com/ruby/ruby/blob/trunk/parse.y#L3273
 		    {
 			$$ = assignable($2, 0, &@$);
 		    /*%%%*/
-			$$ = new_masgn(0, $$, &@$);
+			$$ = NEW_MASGN(0, $$, &@$);
 		    /*%
 			$$ = mlhs_add_star(mlhs_new(), $$);
 		    %*/
@@ -3336,7 +3282,7 @@ f_margs		: f_marg_list https://github.com/ruby/ruby/blob/trunk/parse.y#L3282
 		    {
 			$$ = as (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]