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

ruby-changes:17435

From: knu <ko1@a...>
Date: Mon, 11 Oct 2010 18:47:41 +0900 (JST)
Subject: [ruby-changes:17435] Ruby:r29440 (ruby_1_8): * parse.y (opt_block_arg): Allow a trailing comma at the end of

knu	2010-10-11 18:34:39 +0900 (Mon, 11 Oct 2010)

  New Revision: 29440

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29440

  Log:
    * parse.y (opt_block_arg): Allow a trailing comma at the end of
      an argument list.

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/NEWS
    branches/ruby_1_8/parse.y

Index: ruby_1_8/parse.y
===================================================================
--- ruby_1_8/parse.y	(revision 29439)
+++ ruby_1_8/parse.y	(revision 29440)
@@ -1423,6 +1423,10 @@
 		    {
 			$$ = $2;
 		    }
+		| ','
+		    {
+			$$ = 0;
+		    }
 		| none
 		;
 
Index: ruby_1_8/NEWS
===================================================================
--- ruby_1_8/NEWS	(revision 29439)
+++ ruby_1_8/NEWS	(revision 29440)
@@ -28,6 +28,17 @@
   equivalent to f.call(x), is supported.  This is mainly for use
   in invoking a Proc.
 
+* trailing comma in argument list
+
+  A trailing comma can be put at the end of an argument list.
+  e.g.
+    MyStruct = Struct.new(
+      :id,
+      :name,
+      :created_at,
+      :description,
+    )
+
 === Configuration changes
 
 * version specific directories
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 29439)
+++ ruby_1_8/ChangeLog	(revision 29440)
@@ -1,3 +1,8 @@
+Mon Oct 11 18:06:57 2010  Akinori MUSHA  <knu@i...>
+
+	* parse.y (opt_block_arg): Allow a trailing comma at the end of
+	  an argument list.
+
 Fri Oct  8 10:51:56 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* common.mk (RBCONFIG): depends on version.h due to

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

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