summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-29 10:47:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-29 10:47:43 +0000
commit65e27c8b138d6959608658ffce2fa761842b8d24 (patch)
treecf3172b4d047af3e96f450b04f406f3c9ded91f2 /parse.y
parentdacf977a42b7268cc752fe0b3b521d39ab7b05e9 (diff)
parse.y: ambiguous parentheses
* parse.y (parser_yylex): warn ambiguous parentheses after a space in method definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index d532954d10..0f3eac1e56 100644
--- a/parse.y
+++ b/parse.y
@@ -8520,6 +8520,10 @@ parser_yylex(struct parser_params *parser)
else if (IS_SPCARG(-1)) {
c = tLPAREN_ARG;
}
+ else if (IS_lex_state(EXPR_ENDFN) && space_seen) {
+ rb_warning0("parentheses after method name is interpreted as");
+ rb_warning0("an argument list, not a decomposed argument");
+ }
paren_nest++;
COND_PUSH(0);
CMDARG_PUSH(0);