[前][次][番号順一覧][スレッド一覧]

ruby-changes:69546

From: Nobuyoshi <ko1@a...>
Date: Sun, 31 Oct 2021 15:16:48 +0900 (JST)
Subject: [ruby-changes:69546] b7f7117bdc (master): Rename `in_kwarg` as `in_argdef` as unrelated to keywords

https://git.ruby-lang.org/ruby.git/commit/?id=b7f7117bdc

From b7f7117bdc78a4a342a57dad1a340b158492ccf3 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 31 Oct 2021 13:55:14 +0900
Subject: Rename `in_kwarg` as `in_argdef` as unrelated to keywords

---
 parse.y | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/parse.y b/parse.y
index 14393abad08..acea8244738 100644
--- a/parse.y
+++ b/parse.y
@@ -63,7 +63,7 @@ enum shareability { https://github.com/ruby/ruby/blob/trunk/parse.y#L63
 
 struct lex_context {
     unsigned int in_defined: 1;
-    unsigned int in_kwarg: 1;
+    unsigned int in_argdef: 1;
     unsigned int in_def: 1;
     unsigned int in_class: 1;
     BITFIELD(enum shareability, shareable_constant_value, 2);
@@ -1759,13 +1759,13 @@ expr		: command_call https://github.com/ruby/ruby/blob/trunk/parse.y#L1759
 			SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
 			p->command_start = FALSE;
 			$<ctxt>2 = p->ctxt;
-			p->ctxt.in_kwarg = 1;
+			p->ctxt.in_argdef = 1;
 			$<tbl>$ = push_pvtbl(p);
 		    }
 		  p_top_expr_body
 		    {
 			pop_pvtbl(p, $<tbl>3);
-			p->ctxt.in_kwarg = $<ctxt>2.in_kwarg;
+			p->ctxt.in_argdef = $<ctxt>2.in_argdef;
 		    /*%%%*/
 			$$ = NEW_CASE3($1, NEW_IN($4, 0, 0, &@4), &@$);
 		    /*% %*/
@@ -1777,13 +1777,13 @@ expr		: command_call https://github.com/ruby/ruby/blob/trunk/parse.y#L1777
 			SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
 			p->command_start = FALSE;
 			$<ctxt>2 = p->ctxt;
-			p->ctxt.in_kwarg = 1;
+			p->ctxt.in_argdef = 1;
 			$<tbl>$ = push_pvtbl(p);
 		    }
 		  p_top_expr_body
 		    {
 			pop_pvtbl(p, $<tbl>3);
-			p->ctxt.in_kwarg = $<ctxt>1.in_kwarg;
+			p->ctxt.in_argdef = $<ctxt>1.in_argdef;
 		    /*%%%*/
 			$$ = NEW_CASE3($1, NEW_IN($4, NEW_TRUE(&@4), NEW_FALSE(&@4), &@4), &@$);
 		    /*% %*/
@@ -4050,7 +4050,7 @@ p_case_body	: keyword_in https://github.com/ruby/ruby/blob/trunk/parse.y#L4050
 			SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
 			p->command_start = FALSE;
 			$<ctxt>1 = p->ctxt;
-			p->ctxt.in_kwarg = 1;
+			p->ctxt.in_argdef = 1;
 			$<tbl>$ = push_pvtbl(p);
 		    }
 		    {
@@ -4060,7 +4060,7 @@ p_case_body	: keyword_in https://github.com/ruby/ruby/blob/trunk/parse.y#L4060
 		    {
 			pop_pktbl(p, $<tbl>3);
 			pop_pvtbl(p, $<tbl>2);
-			p->ctxt.in_kwarg = $<ctxt>1.in_kwarg;
+			p->ctxt.in_argdef = $<ctxt>1.in_argdef;
 		    }
 		  compstmt
 		  p_cases
@@ -4234,12 +4234,12 @@ p_expr_basic	: p_value https://github.com/ruby/ruby/blob/trunk/parse.y#L4234
 		    {
 			$<tbl>$ = push_pktbl(p);
 			$<ctxt>1 = p->ctxt;
-			p->ctxt.in_kwarg = 0;
+			p->ctxt.in_argdef = 0;
 		    }
 		  p_kwargs rbrace
 		    {
 			pop_pktbl(p, $<tbl>2);
-			p->ctxt.in_kwarg = $<ctxt>1.in_kwarg;
+			p->ctxt.in_argdef = $<ctxt>1.in_argdef;
 			$$ = new_hash_pattern(p, Qnone, $3, &@$);
 		    }
 		| tLBRACE rbrace
@@ -5153,12 +5153,12 @@ f_paren_args	: '(' f_args rparen https://github.com/ruby/ruby/blob/trunk/parse.y#L5153
 f_arglist	: f_paren_args
 		|   {
 			$<ctxt>$ = p->ctxt;
-			p->ctxt.in_kwarg = 1;
+			p->ctxt.in_argdef = 1;
 			SET_LEX_STATE(p->lex.state|EXPR_LABEL); /* force for args */
 		    }
 		  f_args term
 		    {
-			p->ctxt.in_kwarg = $<ctxt>1.in_kwarg;
+			p->ctxt.in_argdef = $<ctxt>1.in_argdef;
 			$$ = $2;
 			SET_LEX_STATE(EXPR_BEG);
 			p->command_start = TRUE;
@@ -9286,7 +9286,7 @@ parser_yylex(struct parser_params *p) https://github.com/ruby/ruby/blob/trunk/parse.y#L9286
                 dispatch_scan_event(p, tIGNORED_NL);
             }
             fallthru = FALSE;
-	    if (!c && p->ctxt.in_kwarg) {
+	    if (!c && p->ctxt.in_argdef) {
 		goto normal_newline;
 	    }
 	    goto retry;
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]