From f22345427a588e2f69151c60106beef9c00d04e7 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 15 Sep 2017 08:47:46 +0000 Subject: [PATCH] parse.y: use SET_LEX_STATE * parse.y (f_arglist, parser_yylex): set lex_state via SET_LEX_STATE macro for yydebug messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/parse.y b/parse.y index 60d40e2b92..3b84c2e4e7 100644 --- a/parse.y +++ b/parse.y @@ -4195,7 +4195,7 @@ f_arglist : '(' f_args rparen | { $$ = 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 *parser) 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 *parser) 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 *parser) 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;