From 046c94380bda1aafe99f56a854f9d44478381b1d Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 9 May 2017 17:12:43 +0000 Subject: parse.y: do after cmdarg in paren * parse.y (parser_yylex): set state to ENDARG after a string literal, so that `do` after a literal should be `do_block` and bound to the outer method, as well as a numeric/symbol literal. [ruby-core:72482] [Bug #11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 4de9844987..3b9f8f03fa 100644 --- a/parse.y +++ b/parse.y @@ -7886,7 +7886,7 @@ parser_yylex(struct parser_params *parser) if (token == tSTRING_END || token == tREGEXP_END || token == tLABEL_END) { rb_gc_force_recycle((VALUE)lex_strterm); lex_strterm = 0; - SET_LEX_STATE(token == tLABEL_END ? EXPR_BEG|EXPR_LABEL : EXPR_END); + SET_LEX_STATE(token == tLABEL_END ? EXPR_BEG|EXPR_LABEL : EXPR_ENDARG); } } return token; -- cgit v1.2.3