Skip to content

Commit 6fcb8fc

Browse files
committed
Disallow it implicit in eval
1 parent fc6409a commit 6fcb8fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/prism.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6668,6 +6668,7 @@ pm_node_check_it(pm_parser_t *parser, pm_node_t *node) {
66686668
if (
66696669
(parser->version != PM_OPTIONS_VERSION_CRUBY_3_3_0) &&
66706670
!parser->current_scope->closed &&
6671+
(parser->current_scope->numbered_parameters != PM_SCOPE_NUMBERED_PARAMETERS_DISALLOWED) &&
66716672
pm_node_is_it(parser, node)
66726673
) {
66736674
pm_local_variable_read_node_t *read = pm_local_variable_read_node_create_it(parser, &parser->previous);
@@ -14299,7 +14300,12 @@ parse_pattern_primitive(pm_parser_t *parser, pm_diagnostic_id_t diag_id) {
1429914300
pm_node_t *variable = (pm_node_t *) parse_variable(parser);
1430014301

1430114302
if (variable == NULL) {
14302-
if (parser->version != PM_OPTIONS_VERSION_CRUBY_3_3_0 && pm_token_is_it(parser->previous.start, parser->previous.end)) {
14303+
if (
14304+
(parser->version != PM_OPTIONS_VERSION_CRUBY_3_3_0) &&
14305+
!parser->current_scope->closed &&
14306+
(parser->current_scope->numbered_parameters != PM_SCOPE_NUMBERED_PARAMETERS_DISALLOWED) &&
14307+
pm_token_is_it(parser->previous.start, parser->previous.end)
14308+
) {
1430314309
pm_local_variable_read_node_t *read = pm_local_variable_read_node_create_it(parser, &parser->previous);
1430414310
if (read == NULL) read = pm_local_variable_read_node_create(parser, &parser->previous, 0);
1430514311
variable = (pm_node_t *) read;

0 commit comments

Comments
 (0)