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

ruby-changes:41186

From: nagachika <ko1@a...>
Date: Wed, 23 Dec 2015 06:17:05 +0900 (JST)
Subject: [ruby-changes:41186] nagachika:r53258 (ruby_2_2): merge revision(s) 53214, 53215: [Backport #11849]

nagachika	2015-12-23 06:16:44 +0900 (Wed, 23 Dec 2015)

  New Revision: 53258

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

  Log:
    merge revision(s) 53214,53215: [Backport #11849]
    
    * parse.y (parser_yylex): allow here documents in labeled
      argument.  [ruby-core:72396] [Bug #11849]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/parse.y
    branches/ruby_2_2/test/ruby/test_syntax.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 53257)
+++ ruby_2_2/ChangeLog	(revision 53258)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Wed Dec 23 06:05:50 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (parser_yylex): allow here documents in labeled
+	  argument.  [ruby-core:72396] [Bug #11849]
+
 Wed Dec 23 05:52:06 2015  Yuki Yugui Sonoda  <yugui@y...>
 
 	* test/ruby/test_syntax.rb: fix typo in test
Index: ruby_2_2/parse.y
===================================================================
--- ruby_2_2/parse.y	(revision 53257)
+++ ruby_2_2/parse.y	(revision 53258)
@@ -8123,7 +8123,7 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/ruby_2_2/parse.y#L8123
 	if (c == '<' &&
 	    !IS_lex_state(EXPR_DOT | EXPR_CLASS) &&
 	    !IS_END() &&
-	    (!IS_ARG() || space_seen)) {
+	    (!IS_ARG() || IS_lex_state(EXPR_LABELED) || space_seen)) {
 	    int token = heredoc_identifier();
 	    if (token) return token;
 	}
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 53257)
+++ ruby_2_2/version.h	(revision 53258)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.5"
 #define RUBY_RELEASE_DATE "2015-12-23"
-#define RUBY_PATCHLEVEL 234
+#define RUBY_PATCHLEVEL 235
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 12
Index: ruby_2_2/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_2/test/ruby/test_syntax.rb	(revision 53257)
+++ ruby_2_2/test/ruby/test_syntax.rb	(revision 53258)
@@ -332,6 +332,14 @@ WARN https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_syntax.rb#L332
     assert_valid_syntax('{label: %w(*)}', bug11812)
   end
 
+  def test_heredoc_after_label
+    bug11849 = '[ruby-core:72396] [Bug #11849]'
+    assert_valid_syntax("{label:<<DOC\n""DOC\n""}", bug11849)
+    assert_valid_syntax("{label:<<-DOC\n""DOC\n""}", bug11849)
+    assert_valid_syntax("{label: <<DOC\n""DOC\n""}", bug11849)
+    assert_valid_syntax("{label: <<-DOC\n""DOC\n""}", bug11849)
+  end
+
   def test_duplicated_arg
     assert_syntax_error("def foo(a, a) end", /duplicated argument name/)
     assert_nothing_raised { def foo(_, _) end }

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53214-53215


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

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