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

ruby-changes:15533

From: nobu <ko1@a...>
Date: Thu, 22 Apr 2010 16:43:51 +0900 (JST)
Subject: [ruby-changes:15533] Ruby:r27436 (trunk): * parse.y (warn_balanced): removed false warning.

nobu	2010-04-22 16:43:33 +0900 (Thu, 22 Apr 2010)

  New Revision: 27436

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

  Log:
    * parse.y (warn_balanced): removed false warning.
    
    * parse.y (parser_yylex): skip whitespaces after method name.

  Modified files:
    trunk/ChangeLog
    trunk/parse.y

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27435)
+++ ChangeLog	(revision 27436)
@@ -1,3 +1,9 @@
+Thu Apr 22 16:43:31 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (warn_balanced): removed false warning.
+
+	* parse.y (parser_yylex): skip whitespaces after method name.
+
 Wed Apr 22 02:16:00 2010  Kenta Murata <mrkn@m...>
 
 	* ext/bigdecimal/bigdecimal.[ch]: replace _DEBUG with BIGDECIMAL_DEBUG
Index: parse.y
===================================================================
--- parse.y	(revision 27435)
+++ parse.y	(revision 27436)
@@ -6485,7 +6485,10 @@
 #else
 #define ambiguous_operator(op, syn) dispatch2(operator_ambiguous, ripper_intern(op), rb_str_new_cstr(syn))
 #endif
-#define warn_balanced(op, syn) (space_seen && !ISSPACE(c) && (ambiguous_operator(op, syn), 0))
+#define warn_balanced(op, syn) \
+    (lex_state != EXPR_DOT && lex_state != EXPR_FNAME && \
+     space_seen && !ISSPACE(c) && \
+     (ambiguous_operator(op, syn), 0))
 
 static int
 parser_yylex(struct parser_params *parser)
@@ -7699,6 +7702,11 @@
 		}
 	    }
 
+	    if (lex_state == EXPR_FNAME) {
+		const char *p = lex_p, *pe = lex_pend;
+		while (p < pe && (*p == ' ' || *p == '\t')) p++;
+		if (p < pe && *p != '(') lex_p = p;
+	    }
 	    if ((lex_state == EXPR_BEG && !cmd_state) ||
 		IS_ARG()) {
 		if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {

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

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