Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 40dec90

Browse files
committedFeb 27, 2024
Switch invalid _1 targeting even on syntax error
1 parent e1a9a1d commit 40dec90

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed
 

‎src/prism.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11414,12 +11414,10 @@ parse_target(pm_parser_t *parser, pm_node_t *target) {
1141411414
target->type = PM_GLOBAL_VARIABLE_TARGET_NODE;
1141511415
return target;
1141611416
case PM_LOCAL_VARIABLE_READ_NODE:
11417-
if (pm_token_is_numbered_parameter(target->location.start, target->location.end)) {
11418-
PM_PARSER_ERR_NODE_FORMAT(parser, target, PM_ERR_PARAMETER_NUMBERED_RESERVED, target->location.start);
11419-
} else {
11420-
assert(sizeof(pm_local_variable_target_node_t) == sizeof(pm_local_variable_read_node_t));
11421-
target->type = PM_LOCAL_VARIABLE_TARGET_NODE;
11422-
}
11417+
pm_refute_numbered_parameter(parser, target->location.start, target->location.end);
11418+
11419+
assert(sizeof(pm_local_variable_target_node_t) == sizeof(pm_local_variable_read_node_t));
11420+
target->type = PM_LOCAL_VARIABLE_TARGET_NODE;
1142311421

1142411422
return target;
1142511423
case PM_INSTANCE_VARIABLE_READ_NODE:

0 commit comments

Comments
 (0)
Please sign in to comment.