diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-19 01:38:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-01-19 01:38:59 +0000 |
commit | 6dccc53368652ba5fe0392d0ca8425c79727344a (patch) | |
tree | 2dc146af38fc3b4ce9451ff2c7f9ad10225f8bc7 /parse.y | |
parent | f850b2957d216e74010a76615e65e797f2915d92 (diff) | |
download | ruby-6dccc53368652ba5fe0392d0ca8425c79727344a.tar.gz |
parse.y: warn space
* parse.y (parser_yylex): warn parentheses after space.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -8536,11 +8536,18 @@ parser_yylex(struct parser_params *parser) } else if (IS_SPCARG(-1)) { c = tLPAREN_ARG; + if (lex_state == EXPR_ARG) { + rb_warning0("parentheses after method name and a space is interpreted as " + "an argument list, not a parenthesed argument"); + } } else if (IS_lex_state(EXPR_ENDFN) && space_seen && !lambda_beginning_p()) { rb_warning0("parentheses after method name is interpreted as " "an argument list, not a decomposed argument"); } + else if (lex_state == (EXPR_END|EXPR_LABEL) && space_seen) { + rb_warning0("don't put space before argument parentheses"); + } paren_nest++; COND_PUSH(0); CMDARG_PUSH(0); |