summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorydah <[email protected]>2024-10-03 23:02:03 +0900
committerYudai Takada <[email protected]>2025-01-03 22:13:20 +0900
commit5cc4240dda72582456dc271ec580178d070197a9 (patch)
treeb3f81abe80eff7376784985a0c0178010b55c5ae
parent27e61e2df749c82ea3e9d9e6d1004ed718fefeee (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.y15
1 files changed, 2 insertions, 13 deletions
diff --git a/parse.y b/parse.y
index 5b26693423..1f77c7f3d6 100644
--- a/parse.y
+++ b/parse.y
@@ -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) %*/