From caa7eaecc5b0d2d97c56abe336270541a06702ed Mon Sep 17 00:00:00 2001 From: ydah Date: Sun, 9 Mar 2025 01:39:36 +0900 Subject: [PATCH] Refactor parser rules to remove inline_operation --- parse.y | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/parse.y b/parse.y index fff201bc24..7cb73bafc7 100644 --- a/parse.y +++ b/parse.y @@ -2795,7 +2795,7 @@ rb_parser_ary_free(rb_parser_t *p, rb_parser_ary_t *ary) %type p_args p_args_head p_args_tail p_args_post p_arg p_rest %type p_value p_primitive p_primitive_value p_variable p_var_ref p_expr_ref p_const %type p_kwargs p_kwarg p_kw -%type keyword_variable user_variable sym operation operation2 operation3 +%type keyword_variable user_variable sym operation2 operation3 %type cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg %type f_kwrest f_label f_arg_asgn call_op call_op2 reswords relop dot_or_colon %type p_kwrest p_kwnorest p_any_kwrest p_kw_label @@ -2910,9 +2910,6 @@ rb_parser_ary_free(rb_parser_t *p, rb_parser_ary_t *ary) | keyword_variable ; -%rule %inline inline_operation : ident_or_const - | tFID - ; /* * parameterizing rules */ @@ -3781,7 +3778,7 @@ cpath : tCOLON3 cname } ; -fname : inline_operation +fname : operation | op { SET_LEX_STATE(EXPR_ENDFN); @@ -6716,8 +6713,9 @@ assoc : arg_value tASSOC arg_value } ; -operation : inline_operation - ; +%rule %inline operation : ident_or_const + | tFID + ; operation2 : operation | op