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

ruby-changes:49859

From: nobu <ko1@a...>
Date: Sat, 20 Jan 2018 14:48:03 +0900 (JST)
Subject: [ruby-changes:49859] nobu:r61977 (trunk): parse.y: moved excessed_comma

nobu	2018-01-20 14:47:59 +0900 (Sat, 20 Jan 2018)

  New Revision: 61977

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

  Log:
    parse.y: moved excessed_comma
    
    * parse.y (block_param): embed excessed_comma event result in
      place of rest argument, instead of dispatching with the whole
      parameters.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61976)
+++ parse.y	(revision 61977)
@@ -2888,8 +2888,16 @@ block_param	: f_arg ',' f_block_optarg ' https://github.com/ruby/ruby/blob/trunk/parse.y#L2888
 		    }
 		| f_arg ','
 		    {
-			$$ = new_args(p, $1, Qnone, 1, Qnone, new_args_tail(p, Qnone, Qnone, Qnone, &@1), &@$);
-		    /*% ripper: excessed_comma!("$$") %*/
+#ifndef RIPPER
+			/* magic number for rest_id in iseq_set_arguments() */
+			const ID excessed_comma = 1;
+#else
+			const VALUE excessed_comma =
+			    /*% ripper: excessed_comma! %*/
+			    ;
+#endif
+			$$ = new_args_tail(p, Qnone, Qnone, Qnone, &@1);
+			$$ = new_args(p, $1, Qnone, excessed_comma, Qnone, $$, &@$);
 		    }
 		| f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail
 		    {

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

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