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

ruby-changes:38047

From: nagachika <ko1@a...>
Date: Tue, 31 Mar 2015 00:29:47 +0900 (JST)
Subject: [ruby-changes:38047] nagachika:r50128 (ruby_2_1): merge revision(s) r49964: [Backport #10957]

nagachika	2015-03-31 00:29:28 +0900 (Tue, 31 Mar 2015)

  New Revision: 50128

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

  Log:
    merge revision(s) r49964: [Backport #10957]
    
    * parse.y (primary): empty parentheses at cmdarg can be null.
      [ruby-core:68477] [Bug #10957]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/parse.y
    branches/ruby_2_1/test/ruby/test_syntax.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 50127)
+++ ruby_2_1/ChangeLog	(revision 50128)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Tue Mar 31 00:18:12 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (primary): empty parentheses at cmdarg can be null.
+	  [ruby-core:68477] [Bug #10957]
+
 Mon Mar 30 23:30:57 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/io/console/console.c (console_dev): id_console is not a
Index: ruby_2_1/parse.y
===================================================================
--- ruby_2_1/parse.y	(revision 50127)
+++ ruby_2_1/parse.y	(revision 50128)
@@ -2046,7 +2046,7 @@ arg		: lhs '=' arg https://github.com/ruby/ruby/blob/trunk/ruby_2_1/parse.y#L2046
 			value_expr($1);
 			value_expr($3);
 			$$ = NEW_DOT2($1, $3);
-			if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
+			if ($1 && nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
 			    nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
 			    deferred_nodes = list_append(deferred_nodes, $$);
 			}
@@ -2060,7 +2060,7 @@ arg		: lhs '=' arg https://github.com/ruby/ruby/blob/trunk/ruby_2_1/parse.y#L2060
 			value_expr($1);
 			value_expr($3);
 			$$ = NEW_DOT3($1, $3);
-			if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
+			if ($1 && nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
 			    nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
 			    deferred_nodes = list_append(deferred_nodes, $$);
 			}
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 50127)
+++ ruby_2_1/version.h	(revision 50128)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.5"
-#define RUBY_RELEASE_DATE "2015-03-30"
-#define RUBY_PATCHLEVEL 323
+#define RUBY_RELEASE_DATE "2015-03-31"
+#define RUBY_PATCHLEVEL 324
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 30
+#define RUBY_RELEASE_DAY 31
 
 #include "ruby/version.h"
 
Index: ruby_2_1/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_1/test/ruby/test_syntax.rb	(revision 50127)
+++ ruby_2_1/test/ruby/test_syntax.rb	(revision 50128)
@@ -408,6 +408,12 @@ eom https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_syntax.rb#L408
     assert_syntax_error(code, /def n "\u{2208}"; end/, bug10114)
   end
 
+  def test_null_range_cmdarg
+    bug10957 = '[ruby-core:68477] [Bug #10957]'
+    assert_ruby_status(['-c', '-e', 'p ()..0'], "", bug10957)
+    assert_ruby_status(['-c', '-e', 'p ()...0'], "", bug10957)
+  end
+
   private
 
   def not_label(x) @result = x; @not_label ||= nil end

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r49964


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

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