ruby-changes:49653
From: mame <ko1@a...>
Date: Thu, 11 Jan 2018 22:42:23 +0900 (JST)
Subject: [ruby-changes:49653] mame:r61769 (trunk): parse.y: disentangle the lexer handling of ')', ']', and '}'
mame 2018-01-11 22:42:18 +0900 (Thu, 11 Jan 2018) New Revision: 61769 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61769 Log: parse.y: disentangle the lexer handling of ')', ']', and '}' Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61768) +++ parse.y (revision 61769) @@ -8488,18 +8488,25 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8488 return parse_numeric(parser, c); case ')': + COND_LEXPOP(); + CMDARG_LEXPOP(); + SET_LEX_STATE(EXPR_ENDFN); + paren_nest--; + return c; + case ']': + COND_LEXPOP(); + CMDARG_LEXPOP(); + SET_LEX_STATE(EXPR_END); + paren_nest--; + return c; + case '}': COND_LEXPOP(); CMDARG_LEXPOP(); - if (c == ')') - SET_LEX_STATE(EXPR_ENDFN); - else - SET_LEX_STATE(EXPR_END); - if (c == '}') { - if (!brace_nest--) c = tSTRING_DEND; - } - if (c != tSTRING_DEND) paren_nest--; + SET_LEX_STATE(EXPR_END); + if (!brace_nest--) return tSTRING_DEND; + paren_nest--; return c; case ':': -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/