Skip to content

Commit 8d73a18

Browse files
kddnewtonmatzbot
authored andcommitted
[ruby/prism] Handle destroying implicit parameter
Fixes ruby/prism#3740 ruby/prism@464a849184
1 parent 3902205 commit 8d73a18

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

prism/prism.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13849,6 +13849,18 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod
1384913849
// syntax error. In this case we'll fall through to our default
1385013850
// handling. We need to free the value that we parsed because there
1385113851
// is no way for us to attach it to the tree at this point.
13852+
switch (PM_NODE_TYPE(value)) {
13853+
case PM_LOCAL_VARIABLE_READ_NODE:
13854+
case PM_IT_LOCAL_VARIABLE_READ_NODE:
13855+
// Since it is possible for the value to be an implicit
13856+
// parameter, we need to remove it from the list of implicit
13857+
// parameters.
13858+
parse_target_implicit_parameter(parser, value);
13859+
break;
13860+
default:
13861+
break;
13862+
}
13863+
1385213864
pm_node_destroy(parser, value);
1385313865
}
1385413866
PRISM_FALLTHROUGH

0 commit comments

Comments
 (0)