[ruby/prism] Switch invalid _1 targeting even on syntax error
https://github.com/ruby/prism/commit/40dec909b7
This commit is contained in:
parent
fc36882713
commit
f67c9d001a
@ -11414,12 +11414,10 @@ parse_target(pm_parser_t *parser, pm_node_t *target) {
|
|||||||
target->type = PM_GLOBAL_VARIABLE_TARGET_NODE;
|
target->type = PM_GLOBAL_VARIABLE_TARGET_NODE;
|
||||||
return target;
|
return target;
|
||||||
case PM_LOCAL_VARIABLE_READ_NODE:
|
case PM_LOCAL_VARIABLE_READ_NODE:
|
||||||
if (pm_token_is_numbered_parameter(target->location.start, target->location.end)) {
|
pm_refute_numbered_parameter(parser, target->location.start, target->location.end);
|
||||||
PM_PARSER_ERR_NODE_FORMAT(parser, target, PM_ERR_PARAMETER_NUMBERED_RESERVED, target->location.start);
|
|
||||||
} else {
|
assert(sizeof(pm_local_variable_target_node_t) == sizeof(pm_local_variable_read_node_t));
|
||||||
assert(sizeof(pm_local_variable_target_node_t) == sizeof(pm_local_variable_read_node_t));
|
target->type = PM_LOCAL_VARIABLE_TARGET_NODE;
|
||||||
target->type = PM_LOCAL_VARIABLE_TARGET_NODE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
return target;
|
||||||
case PM_INSTANCE_VARIABLE_READ_NODE:
|
case PM_INSTANCE_VARIABLE_READ_NODE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user