summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-22 07:43:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-22 07:43:33 +0000
commit36f8540a2b024ee30092ea6a0eebfa40ccc95b07 (patch)
tree96c2e4679c6195ef6171d2a313e1687151676930
parent6a77fa1d158dcbb3d66baced48334935b91d3fca (diff)
* parse.y (warn_balanced): removed false warning.
* parse.y (parser_yylex): skip whitespaces after method name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--parse.y10
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bcb9e00..586c7a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Apr 22 16:43:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@mrkn.jp>
* ext/bigdecimal/bigdecimal.[ch]: replace _DEBUG with BIGDECIMAL_DEBUG
diff --git a/parse.y b/parse.y
index de1aee7..c88a727 100644
--- a/parse.y
+++ b/parse.y
@@ -6485,7 +6485,10 @@ parser_prepare(struct parser_params *parser)
#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 @@ parser_yylex(struct parser_params *parser)
}
}
+ 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] == ':')) {