diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-26 13:40:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-26 13:40:14 +0000 |
commit | fbb9e6c1eb8ec1870a70b360038430d9ef1b1e08 (patch) | |
tree | 947bca4753e674b55cbb837b99e3bfeb77b2f2df | |
parent | 33118bf77ba4c9e49e2c616e7c32911832e6c5e5 (diff) | |
download | ruby-fbb9e6c1eb8ec1870a70b360038430d9ef1b1e08.tar.gz |
parse.y: moved duplicate conditions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | parse.y | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -8458,16 +8458,16 @@ parser_yylex(struct parser_params *parser) if (IS_BEG()) { c = tLPAREN; } - else if (IS_SPCARG(-1)) { + else if (!space_seen) { + /* foo( ... ) => method call, no ambiguity */ + } + else if (IS_ARG() || IS_lex_state_all(EXPR_END|EXPR_LABEL)) { c = tLPAREN_ARG; } - else if (IS_lex_state(EXPR_ENDFN) && space_seen && !lambda_beginning_p()) { + else if (IS_lex_state(EXPR_ENDFN) && !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) { - c = tLPAREN_ARG; - } paren_nest++; COND_PUSH(0); CMDARG_PUSH(0); |