From b7f5c8003639b86cea50389fac541e2565e7e694 Mon Sep 17 00:00:00 2001 From: ydah Date: Wed, 21 Feb 2024 22:12:47 +0900 Subject: [PATCH] Use `terms?` instead of `opt_terms` --- parse.y | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/parse.y b/parse.y index 437cb83022..b3794f20d8 100644 --- a/parse.y +++ b/parse.y @@ -2903,7 +2903,7 @@ program : { } ; -top_compstmt : top_stmts opt_terms +top_compstmt : top_stmts terms? { $$ = void_stmts(p, $1); } @@ -2980,7 +2980,7 @@ bodystmt : compstmt[body] } ; -compstmt : stmts opt_terms +compstmt : stmts terms? { $$ = void_stmts(p, $1); } @@ -4473,7 +4473,7 @@ primary : literal fixpos($$, $2); /*% ripper: until!($:2, $:3) %*/ } - | k_case expr_value opt_terms + | k_case expr_value terms? { $$ = p->case_labels; p->case_labels = Qnil; @@ -4487,7 +4487,7 @@ primary : literal fixpos($$, $2); /*% ripper: case!($:2, $:5) %*/ } - | k_case opt_terms + | k_case terms? { $$ = p->case_labels; p->case_labels = 0; @@ -4500,7 +4500,7 @@ primary : literal $$ = NEW_CASE2($4, &@$); /*% ripper: case!(Qnil, $:4) %*/ } - | k_case expr_value opt_terms + | k_case expr_value terms? p_case_body k_end { @@ -6942,10 +6942,6 @@ call_op2 : call_op | tCOLON2 ; -opt_terms : /* none */ - | terms - ; - opt_nl : /* none */ | '\n' ;