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

ruby-changes:48984

From: yui-knk <ko1@a...>
Date: Mon, 11 Dec 2017 09:28:32 +0900 (JST)
Subject: [ruby-changes:48984] yui-knk:r61103 (trunk): parse.y: Remove not used argument

yui-knk	2017-12-11 09:28:27 +0900 (Mon, 11 Dec 2017)

  New Revision: 61103

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

  Log:
    parse.y: Remove not used argument
    
    * parse.y (list_append_gen): location is not used.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61102)
+++ parse.y	(revision 61103)
@@ -421,8 +421,8 @@ static void block_dup_check_gen(struct p https://github.com/ruby/ruby/blob/trunk/parse.y#L421
 
 static NODE *block_append_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define block_append(h,t,location) block_append_gen(parser,(h),(t),(location))
-static NODE *list_append_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
-#define list_append(l,i,location) list_append_gen(parser,(l),(i),(location))
+static NODE *list_append_gen(struct parser_params*,NODE*,NODE*);
+#define list_append(l,i) list_append_gen(parser,(l),(i))
 static NODE *list_concat(NODE*,NODE*);
 static NODE *arg_append_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define arg_append(h,t,location) arg_append_gen(parser,(h),(t),(location))
@@ -1788,7 +1788,7 @@ mlhs_basic	: mlhs_head https://github.com/ruby/ruby/blob/trunk/parse.y#L1788
 		| mlhs_head mlhs_item
 		    {
 		    /*%%%*/
-			$$ = new_masgn(list_append($1,$2,&@$), 0, &@$);
+			$$ = new_masgn(list_append($1,$2), 0, &@$);
 		    /*%
 			$$ = mlhs_add($1, $2);
 		    %*/
@@ -1885,7 +1885,7 @@ mlhs_head	: mlhs_item ',' https://github.com/ruby/ruby/blob/trunk/parse.y#L1885
 		| mlhs_head mlhs_item ','
 		    {
 		    /*%%%*/
-			$$ = list_append($1, $2, &@$);
+			$$ = list_append($1, $2);
 		    /*%
 			$$ = mlhs_add($1, $2);
 		    %*/
@@ -1903,7 +1903,7 @@ mlhs_post	: mlhs_item https://github.com/ruby/ruby/blob/trunk/parse.y#L1903
 		| mlhs_post ',' mlhs_item
 		    {
 		    /*%%%*/
-			$$ = list_append($1, $3, &@$);
+			$$ = list_append($1, $3);
 		    /*%
 			$$ = mlhs_add($1, $3);
 		    %*/
@@ -2585,7 +2585,7 @@ args		: arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L2585
 		    /*%%%*/
 			NODE *n1;
 			if ((n1 = splat_array($1)) != 0) {
-			    $$ = list_append(n1, $3, &@$);
+			    $$ = list_append(n1, $3);
 			}
 			else {
 			    $$ = arg_append($1, $3, &@$);
@@ -2619,7 +2619,7 @@ mrhs		: args ',' arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L2619
 		    /*%%%*/
 			NODE *n1;
 			if ((n1 = splat_array($1)) != 0) {
-			    $$ = list_append(n1, $3, &@$);
+			    $$ = list_append(n1, $3);
 			}
 			else {
 			    $$ = arg_append($1, $3, &@$);
@@ -3306,7 +3306,7 @@ f_marg_list	: f_marg https://github.com/ruby/ruby/blob/trunk/parse.y#L3306
 		| f_marg_list ',' f_marg
 		    {
 		    /*%%%*/
-			$$ = list_append($1, $3, &@$);
+			$$ = list_append($1, $3);
 		    /*%
 			$$ = mlhs_add($1, $3);
 		    %*/
@@ -4001,7 +4001,7 @@ word_list	: /* none */ https://github.com/ruby/ruby/blob/trunk/parse.y#L4001
 		| word_list word ' '
 		    {
 		    /*%%%*/
-			$$ = list_append($1, evstr2dstr($2, &@$), &@$);
+			$$ = list_append($1, evstr2dstr($2, &@$));
 		    /*%
 			$$ = dispatch2(words_add, $1, $2);
 		    %*/
@@ -4055,7 +4055,7 @@ symbol_list	: /* none */ https://github.com/ruby/ruby/blob/trunk/parse.y#L4055
 			    nd_set_type($2, NODE_LIT);
 			    add_mark_object($2->nd_lit = rb_str_intern($2->nd_lit));
 			}
-			$$ = list_append($1, $2, &@$);
+			$$ = list_append($1, $2);
 		    /*%
 			$$ = dispatch2(symbols_add, $1, $2);
 		    %*/
@@ -4094,7 +4094,7 @@ qword_list	: /* none */ https://github.com/ruby/ruby/blob/trunk/parse.y#L4094
 		    {
 		    /*%%%*/
 			$2->nd_loc = @2;
-			$$ = list_append($1, $2, &@$);
+			$$ = list_append($1, $2);
 		    /*%
 			$$ = dispatch2(qwords_add, $1, $2);
 		    %*/
@@ -4117,7 +4117,7 @@ qsym_list	: /* none */ https://github.com/ruby/ruby/blob/trunk/parse.y#L4117
 			nd_set_type($2, NODE_LIT);
 			add_mark_object($2->nd_lit = ID2SYM(rb_intern_str(lit)));
 			$2->nd_loc = @2;
-			$$ = list_append($1, $2, &@$);
+			$$ = list_append($1, $2);
 		    /*%
 			$$ = dispatch2(qsymbols_add, $1, $2);
 		    %*/
@@ -4186,10 +4186,10 @@ regexp_contents: /* none */ https://github.com/ruby/ruby/blob/trunk/parse.y#L4186
 			      case NODE_DSTR:
 				break;
 			      default:
-				head = list_append(new_dstr(Qnil, &@$), head, &@$);
+				head = list_append(new_dstr(Qnil, &@$), head);
 				break;
 			    }
-			    $$ = list_append(head, tail, &@$);
+			    $$ = list_append(head, tail);
 			}
 		    /*%
 			VALUE s1 = 1, s2 = 0, n1 = $1, n2 = $2;
@@ -5006,7 +5006,7 @@ assoc		: arg_value tASSOC arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L5006
 			    nd_set_type($1, NODE_LIT);
 			    add_mark_object($1->nd_lit = rb_fstring($1->nd_lit));
 			}
-			$$ = list_append(new_list($1, &@$), $3, &@$);
+			$$ = list_append(new_list($1, &@$), $3);
 		    /*%
 			$$ = dispatch2(assoc_new, $1, $3);
 		    %*/
@@ -5014,7 +5014,7 @@ assoc		: arg_value tASSOC arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L5014
 		| tLABEL arg_value
 		    {
 		    /*%%%*/
-			$$ = list_append(new_list(new_lit(ID2SYM($1), &@1), &@$), $2, &@$);
+			$$ = list_append(new_list(new_lit(ID2SYM($1), &@1), &@$), $2);
 		    /*%
 			$$ = dispatch2(assoc_new, $1, $2);
 		    %*/
@@ -5025,7 +5025,7 @@ assoc		: arg_value tASSOC arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L5025
 			YYLTYPE location;
 			location.first_loc = @1.first_loc;
 			location.last_loc = @3.last_loc;
-			$$ = list_append(new_list(dsym_node($2, &location), &location), $4, &@$);
+			$$ = list_append(new_list(dsym_node($2, &location), &location), $4);
 		    /*%
 			$$ = dispatch2(assoc_new, dispatch1(dyna_symbol, $2), $4);
 		    %*/
@@ -5037,7 +5037,7 @@ assoc		: arg_value tASSOC arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L5037
 			    !($2->nd_head && $2->nd_head->nd_alen))
 			    $$ = 0;
 			else
-			    $$ = list_append(new_list(0, &@$), $2, &@$);
+			    $$ = list_append(new_list(0, &@$), $2);
 		    /*%
 			$$ = dispatch1(assoc_splat, $2);
 		    %*/
@@ -9041,7 +9041,7 @@ block_append_gen(struct parser_params *p https://github.com/ruby/ruby/blob/trunk/parse.y#L9041
 
 /* append item to the list */
 static NODE*
-list_append_gen(struct parser_params *parser, NODE *list, NODE *item, const YYLTYPE *location)
+list_append_gen(struct parser_params *parser, NODE *list, NODE *item)
 {
     NODE *last;
 
@@ -9121,7 +9121,7 @@ literal_concat_gen(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L9121
     htype = nd_type(head);
     if (htype == NODE_EVSTR) {
 	NODE *node = new_dstr(STR_NEW0(), location);
-	head = list_append(node, head, location);
+	head = list_append(node, head);
 	htype = NODE_DSTR;
     }
     if (heredoc_indent > 0) {
@@ -9129,7 +9129,7 @@ literal_concat_gen(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L9129
 	  case NODE_STR:
 	    nd_set_type(head, NODE_DSTR);
 	  case NODE_DSTR:
-	    return list_append(head, tail, location);
+	    return list_append(head, tail);
 	  default:
 	    break;
 	}
@@ -9154,7 +9154,7 @@ literal_concat_gen(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L9154
 	    rb_discard_node(tail);
 	}
 	else {
-	    list_append(head, tail, location);
+	    list_append(head, tail);
 	}
 	break;
 
@@ -9193,7 +9193,7 @@ literal_concat_gen(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L9193
 	    nd_set_type(head, NODE_DSTR);
 	    head->nd_alen = 1;
 	}
-	list_append(head, tail, location);
+	list_append(head, tail);
 	break;
     }
     return head;
@@ -9203,7 +9203,7 @@ static NODE * https://github.com/ruby/ruby/blob/trunk/parse.y#L9203
 evstr2dstr_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
 {
     if (nd_type(node) == NODE_EVSTR) {
-	node = list_append(new_dstr(STR_NEW0(), location), node, location);
+	node = list_append(new_dstr(STR_NEW0(), location), node);
     }
     return node;
 }
@@ -10127,13 +10127,13 @@ arg_append_gen(struct parser_params *par https://github.com/ruby/ruby/blob/trunk/parse.y#L10127
     if (!node1) return new_list(node2, &node2->nd_loc);
     switch (nd_type(node1))  {
       case NODE_ARRAY:
-	return list_append(node1, node2, location);
+	return list_append(node1, node2);
       case NODE_BLOCK_PASS:
 	node1->nd_head = arg_append(node1->nd_head, node2, location);
 	node1->nd_loc.last_loc = node1->nd_head->nd_loc.last_loc;
 	return node1;
       case NODE_ARGSPUSH:
-	node1->nd_body = list_append(new_list(node1->nd_body, &node1->nd_body->nd_loc), node2, location);
+	node1->nd_body = list_append(new_list(node1->nd_body, &node1->nd_body->nd_loc), node2);
 	node1->nd_loc.last_loc = node1->nd_body->nd_loc.last_loc;
 	nd_set_type(node1, NODE_ARGSCAT);
 	return node1;

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

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