diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-25 14:57:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-25 14:57:18 +0000 |
commit | dcd1e5e5c298b35899c962985b4d195781c6397d (patch) | |
tree | f0ed30ddbba72cca48a4e9c7f2d0c561b4f20d6c /parse.y | |
parent | 6df5f314ac7809e2aedc22a961cf31c4e3f21d42 (diff) | |
download | ruby-dcd1e5e5c298b35899c962985b4d195781c6397d.tar.gz |
parse.y: required kwarg without parentheses
* parse.y (parser_yylex): only a newline after label should be
significant. [ruby-core:61658] [Bug #9669]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -7017,13 +7017,16 @@ parser_yylex(struct parser_params *parser) #endif /* fall through */ case '\n': - if (IS_lex_state(EXPR_BEG | EXPR_VALUE | EXPR_CLASS | EXPR_FNAME | EXPR_DOT)) { + if (IS_lex_state(EXPR_BEG | EXPR_VALUE | EXPR_CLASS | EXPR_FNAME | EXPR_DOT | EXPR_LABELARG)) { #ifdef RIPPER if (!fallthru) { ripper_dispatch_scan_event(parser, tIGNORED_NL); } fallthru = FALSE; #endif + if (IS_lex_state(EXPR_LABELARG) && parser->parser_in_kwarg) { + goto normal_newline; + } goto retry; } while ((c = nextc())) { |