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

ruby-changes:70817

From: Vladimir <ko1@a...>
Date: Tue, 11 Jan 2022 19:59:52 +0900 (JST)
Subject: [ruby-changes:70817] b633c9ac1c (master): Reduce p_args rules with p_rest

https://git.ruby-lang.org/ruby.git/commit/?id=b633c9ac1c

From b633c9ac1cc06610c09aaeba1faa2bf3da7d2be0 Mon Sep 17 00:00:00 2001
From: Vladimir Dementyev <dementiev.vm@g...>
Date: Tue, 11 Jan 2022 13:20:19 +0300
Subject: Reduce p_args rules with p_rest

---
 parse.y | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/parse.y b/parse.y
index ffef9955cc3..b1b2c8860b1 100644
--- a/parse.y
+++ b/parse.y
@@ -4319,21 +4319,13 @@ p_args		: p_expr https://github.com/ruby/ruby/blob/trunk/parse.y#L4319
 			$$ = new_array_pattern_tail(p, pre_args, 0, 0, Qnone, &@$);
 		    %*/
 		    }
-		| p_args_head tSTAR tIDENTIFIER
+		| p_args_head p_rest
 		    {
-			$$ = new_array_pattern_tail(p, $1, 1, $3, Qnone, &@$);
+			$$ = new_array_pattern_tail(p, $1, 1, $2, Qnone, &@$);
 		    }
-		| p_args_head tSTAR tIDENTIFIER ',' p_args_post
+		| p_args_head p_rest ',' p_args_post
 		    {
-			$$ = new_array_pattern_tail(p, $1, 1, $3, $5, &@$);
-		    }
-		| p_args_head tSTAR
-		    {
-			$$ = new_array_pattern_tail(p, $1, 1, 0, Qnone, &@$);
-		    }
-		| p_args_head tSTAR ',' p_args_post
-		    {
-			$$ = new_array_pattern_tail(p, $1, 1, 0, $4, &@$);
+			$$ = new_array_pattern_tail(p, $1, 1, $2, $4, &@$);
 		    }
 		| p_args_tail
 		;
-- 
cgit v1.2.1


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

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