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
This commit is contained in:
parent
f850b2957d
commit
6dccc53368
7
parse.y
7
parse.y
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user