ruby-changes:47802
From: nobu <ko1@a...>
Date: Fri, 15 Sep 2017 17:47:52 +0900 (JST)
Subject: [ruby-changes:47802] nobu:r59920 (trunk): parse.y: use SET_LEX_STATE
nobu 2017-09-15 17:47:46 +0900 (Fri, 15 Sep 2017) New Revision: 59920 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59920 Log: parse.y: use SET_LEX_STATE * parse.y (f_arglist, parser_yylex): set lex_state via SET_LEX_STATE macro for yydebug messages. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 59919) +++ parse.y (revision 59920) @@ -4195,7 +4195,7 @@ f_arglist : '(' f_args rparen https://github.com/ruby/ruby/blob/trunk/parse.y#L4195 | { $<num>$ = parser->in_kwarg; parser->in_kwarg = 1; - lex_state |= EXPR_LABEL; /* force for args */ + SET_LEX_STATE(lex_state|EXPR_LABEL); /* force for args */ } f_args term { @@ -8478,8 +8478,8 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8478 case '[': paren_nest++; if (IS_AFTER_OPERATOR()) { - SET_LEX_STATE(EXPR_ARG); if ((c = nextc()) == ']') { + SET_LEX_STATE(EXPR_ARG); if ((c = nextc()) == '=') { return tASET; } @@ -8487,7 +8487,7 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8487 return tAREF; } pushback(c); - lex_state |= EXPR_LABEL; + SET_LEX_STATE(EXPR_ARG|EXPR_LABEL); return '['; } else if (IS_BEG()) { @@ -8521,8 +8521,7 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L8521 c = tLBRACE; /* hash */ COND_PUSH(0); CMDARG_PUSH(0); - SET_LEX_STATE(EXPR_BEG); - if (c != tLBRACE_ARG) lex_state |= EXPR_LABEL; + SET_LEX_STATE(c == tLBRACE_ARG ? EXPR_BEG : EXPR_BEG|EXPR_LABEL); if (c != tLBRACE) command_start = TRUE; return c; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/