summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2025-11-23 13:58:50 -0500
committergit <svn-admin@ruby-lang.org>2025-11-23 19:10:29 +0000
commit8d73a181879d3151bb5e7ecf928ec098d154d498 (patch)
tree82bc6ea5120649572a58def0d0446aaaf688a935
parent390220579b7afe433731f4d2d119a57858e27911 (diff)
[ruby/prism] Handle destroying implicit parameter
Fixes https://github.com/ruby/prism/pull/3740 https://github.com/ruby/prism/commit/464a849184
-rw-r--r--prism/prism.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/prism/prism.c b/prism/prism.c
index a5475b1753..2e0c941918 100644
--- a/prism/prism.c
+++ b/prism/prism.c
@@ -13849,6 +13849,18 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod
// syntax error. In this case we'll fall through to our default
// handling. We need to free the value that we parsed because there
// is no way for us to attach it to the tree at this point.
+ switch (PM_NODE_TYPE(value)) {
+ case PM_LOCAL_VARIABLE_READ_NODE:
+ case PM_IT_LOCAL_VARIABLE_READ_NODE:
+ // Since it is possible for the value to be an implicit
+ // parameter, we need to remove it from the list of implicit
+ // parameters.
+ parse_target_implicit_parameter(parser, value);
+ break;
+ default:
+ break;
+ }
+
pm_node_destroy(parser, value);
}
PRISM_FALLTHROUGH