diff options
author | ydah <[email protected]> | 2024-10-03 23:02:03 +0900 |
---|---|---|
committer | Yudai Takada <[email protected]> | 2025-01-03 22:13:20 +0900 |
commit | 5cc4240dda72582456dc271ec580178d070197a9 (patch) | |
tree | b3f81abe80eff7376784985a0c0178010b55c5ae | |
parent | 27e61e2df749c82ea3e9d9e6d1004ed718fefeee (diff) |
Refactor parse.y to replace `tIDENTIFIER` and `tCONSTANT` with `ident_or_const` inline rules
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11782
-rw-r--r-- | parse.y | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -3650,7 +3650,7 @@ mlhs_node : user_or_keyword_variable $$ = aryset(p, $1, $3, &@$); /*% ripper: aref_field!($:1, $:3) %*/ } - | primary_value call_op tIDENTIFIER + | primary_value call_op ident_or_const { anddot_multiple_assignment_check(p, &@2, $2); $$ = attrset(p, $1, $2, $3, &@$); @@ -3661,12 +3661,6 @@ mlhs_node : user_or_keyword_variable $$ = attrset(p, $1, idCOLON2, $3, &@$); /*% ripper: const_path_field!($:1, $:3) %*/ } - | primary_value call_op tCONSTANT - { - anddot_multiple_assignment_check(p, &@2, $2); - $$ = attrset(p, $1, $2, $3, &@$); - /*% ripper: field!($:1, $:2, $:3) %*/ - } | primary_value tCOLON2 tCONSTANT { /*% ripper: const_path_field!($:1, $:3) %*/ @@ -3847,12 +3841,7 @@ arg : lhs '=' lex_ctxt arg_rhs $$ = new_ary_op_assign(p, $1, $3, $5, $7, &@3, &@$, &NULL_LOC, &@2, &@4, &@5); /*% ripper: opassign!(aref_field!($:1, $:3), $:5, $:7) %*/ } - | primary_value call_op tIDENTIFIER tOP_ASGN lex_ctxt arg_rhs - { - $$ = new_attr_op_assign(p, $1, $2, $3, $4, $6, &@$, &@2, &@3, &@4); - /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/ - } - | primary_value call_op tCONSTANT tOP_ASGN lex_ctxt arg_rhs + | primary_value call_op ident_or_const tOP_ASGN lex_ctxt arg_rhs { $$ = new_attr_op_assign(p, $1, $2, $3, $4, $6, &@$, &@2, &@3, &@4); /*% ripper: opassign!(field!($:1, $:2, $:3), $:4, $:6) %*/ |