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

ruby-changes:45882

From: nobu <ko1@a...>
Date: Mon, 13 Mar 2017 17:38:16 +0900 (JST)
Subject: [ruby-changes:45882] nobu:r57955 (trunk): parse.y: relax `&' warning

nobu	2017-03-13 17:38:12 +0900 (Mon, 13 Mar 2017)

  New Revision: 57955

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

  Log:
    parse.y: relax `&' warning
    
    * parse.y (parser_yylex): disable "`&' interpreted as argument
      prefix" warning when just followed by a symbol literal.
      [ruby-core:79926] [Misc #13283]

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 57954)
+++ parse.y	(revision 57955)
@@ -8147,7 +8147,12 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8147
 	}
 	pushback(c);
 	if (IS_SPCARG(c)) {
-	    rb_warning0("`&' interpreted as argument prefix");
+	    if ((c != ':') ||
+		(c = peekc_n(1)) == -1 ||
+		!(c == '\'' || c == '"' ||
+		  is_identchar((lex_p+1), lex_pend, current_enc))) {
+		rb_warning0("`&' interpreted as argument prefix");
+	    }
 	    c = tAMPER;
 	}
 	else if (IS_BEG()) {

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

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