1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

parse.y: fix state after left brace

* parse.y (parser_yylex): as well as `tLBRACE_ARG` (expr block),
  `tLBRACE` (primary block) also does not accept a label.  only
  hash brace accepts a label.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-01-21 07:44:25 +00:00
parent 3a12eb82b2
commit 543ed3652f

View file

@ -8082,7 +8082,7 @@ parser_yylex(struct parser_params *p)
c = tLBRACE; /* hash */
COND_PUSH(0);
CMDARG_PUSH(0);
SET_LEX_STATE(c == tLBRACE_ARG ? EXPR_BEG : EXPR_BEG|EXPR_LABEL);
SET_LEX_STATE(c != tLBRACE ? EXPR_BEG : EXPR_BEG|EXPR_LABEL);
if (c != tLBRACE) p->command_start = TRUE;
return c;