summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-25 14:57:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-25 14:57:18 +0000
commitdcd1e5e5c298b35899c962985b4d195781c6397d (patch)
treef0ed30ddbba72cca48a4e9c7f2d0c561b4f20d6c /parse.y
parent6df5f314ac7809e2aedc22a961cf31c4e3f21d42 (diff)
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.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index b3bbef1a51..aab0e40ebd 100644
--- a/parse.y
+++ b/parse.y
@@ -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())) {