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

ruby-changes:35349

From: nobu <ko1@a...>
Date: Sat, 6 Sep 2014 11:08:55 +0900 (JST)
Subject: [ruby-changes:35349] nobu:r47431 (trunk): parse.y: fix warning message

nobu	2014-09-06 11:08:45 +0900 (Sat, 06 Sep 2014)

  New Revision: 47431

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

  Log:
    parse.y: fix warning message
    
    * parse.y (arg_ambiguous_gen): fix warning message, "even" does
      not mean the number of spaces here.  state the place to put a
      space and the operator.  [ruby-core:64790] [Bug #10204]

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47430)
+++ ChangeLog	(revision 47431)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Sep  6 11:08:52 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (arg_ambiguous_gen): fix warning message, "even" does
+	  not mean the number of spaces here.  state the place to put a
+	  space and the operator.  [ruby-core:64790] [Bug #10204]
+
 Sat Sep  6 08:44:40 2014  Zachary Scott  <e@z...>
 
 	* lib/rdoc/generator/template/darkfish/js/jquery.js: Backport
Index: parse.y
===================================================================
--- parse.y	(revision 47430)
+++ parse.y	(revision 47431)
@@ -6588,15 +6588,15 @@ parser_here_document(struct parser_param https://github.com/ruby/ruby/blob/trunk/parse.y#L6588
 #include "lex.c"
 
 static void
-arg_ambiguous_gen(struct parser_params *parser)
+arg_ambiguous_gen(struct parser_params *parser, char c)
 {
 #ifndef RIPPER
-    rb_warning0("ambiguous first argument; put parentheses or even spaces");
+    rb_warningS("ambiguous first argument; put parentheses or a space even after `%c' operator", c);
 #else
-    dispatch0(arg_ambiguous);
+    dispatch1(arg_ambiguous, rb_usascii_str_new(&c, 1));
 #endif
 }
-#define arg_ambiguous() (arg_ambiguous_gen(parser), 1)
+#define arg_ambiguous(c) (arg_ambiguous_gen(parser, (c)), 1)
 
 static ID
 formal_argument_gen(struct parser_params *parser, ID lhs)
@@ -8012,7 +8012,7 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8012
 	    lex_state = EXPR_BEG;
 	    return tOP_ASGN;
 	}
-	if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) {
+	if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous('+'))) {
 	    lex_state = EXPR_BEG;
 	    pushback(c);
 	    if (c != -1 && ISDIGIT(c)) {
@@ -8044,7 +8044,7 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8044
 	    lex_state = EXPR_ENDFN;
 	    return tLAMBDA;
 	}
-	if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) {
+	if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous('-'))) {
 	    lex_state = EXPR_BEG;
 	    pushback(c);
 	    if (c != -1 && ISDIGIT(c)) {
@@ -8134,7 +8134,7 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8134
 	}
 	pushback(c);
 	if (IS_SPCARG(c)) {
-	    (void)arg_ambiguous();
+	    (void)arg_ambiguous('/');
 	    lex_strterm = NEW_STRTERM(str_regexp, '/', 0);
 	    return tREGEXP_BEG;
 	}

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

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