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

ruby-changes:41013

From: yugui <ko1@a...>
Date: Sun, 13 Dec 2015 20:17:31 +0900 (JST)
Subject: [ruby-changes:41013] yugui:r53092 (trunk): * parse.y (parse_percent): Allow %-literals in labeled arg as

yugui	2015-12-13 20:17:18 +0900 (Sun, 13 Dec 2015)

  New Revision: 53092

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

  Log:
    * parse.y (parse_percent): Allow %-literals in labeled arg as
      r51624 did for parentheses.
      Fixes [ruby-core:72084] [Bug #11812].

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
    trunk/test/ruby/test_syntax.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53091)
+++ ChangeLog	(revision 53092)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Dec 13 20:12:14 2015  Yuki Yugui Sonoda  <yugui@y...>
+
+	* parse.y (parse_percent): Allow %-literals in labeled arg as
+	  r51624 did for parentheses.
+	  Fixes [ruby-core:72084] [Bug #11812].
+
 Sun Dec 13 20:02:15 2015  SHIBATA Hiroshi  <hsbt@r...>
 
 	* ChangeLog: fix a typo
Index: parse.y
===================================================================
--- parse.y	(revision 53091)
+++ parse.y	(revision 53092)
@@ -7696,7 +7696,7 @@ parse_percent(struct parser_params *pars https://github.com/ruby/ruby/blob/trunk/parse.y#L7696
 {
     register int c;
 
-    if (IS_lex_state(EXPR_BEG_ANY)) {
+    if (IS_BEG()) {
 	int term;
 	int paren;
 
Index: test/ruby/test_syntax.rb
===================================================================
--- test/ruby/test_syntax.rb	(revision 53091)
+++ test/ruby/test_syntax.rb	(revision 53092)
@@ -335,6 +335,12 @@ WARN https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L335
     assert_valid_syntax("{foo: /=/}", bug11456)
   end
 
+  def test_percent_string_after_label
+    bug11812 = ['ruby-core:72084']
+    assert_valid_syntax('{label:%w(*)}', bug11812)
+    assert_valid_syntax('{label: %w(*)}', bug11812)
+  end
+
   def test_duplicated_arg
     assert_syntax_error("def foo(a, a) end", /duplicated argument name/)
     assert_nothing_raised { def foo(_, _) end }

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

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