Skip to content

Commit 8c12a6b

Browse files
authored
Merge pull request #3791 from stevenjohnstone/bug/3790
2 parents a4fba28 + 173ccb8 commit 8c12a6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/prism.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12762,7 +12762,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p
1276212762
return UP(pm_local_variable_target_node_create(parser, &message_loc, name, 0));
1276312763
}
1276412764

12765-
if (*call->message_loc.start == '_' || parser->encoding->alnum_char(call->message_loc.start, call->message_loc.end - call->message_loc.start)) {
12765+
if (peek_at(parser, call->message_loc.start) == '_' || parser->encoding->alnum_char(call->message_loc.start, call->message_loc.end - call->message_loc.start)) {
1276612766
if (multiple && PM_NODE_FLAG_P(call, PM_CALL_NODE_FLAGS_SAFE_NAVIGATION)) {
1276712767
pm_parser_err_node(parser, (const pm_node_t *) call, PM_ERR_UNEXPECTED_SAFE_NAVIGATION);
1276812768
}
@@ -16118,7 +16118,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag
1611816118
static void
1611916119
parse_pattern_capture(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_constant_id_t capture, const pm_location_t *location) {
1612016120
// Skip this capture if it starts with an underscore.
16121-
if (*location->start == '_') return;
16121+
if (peek_at(parser, location->start) == '_') return;
1612216122

1612316123
if (pm_constant_id_list_includes(captures, capture)) {
1612416124
pm_parser_err(parser, location->start, location->end, PM_ERR_PATTERN_CAPTURE_DUPLICATE);

0 commit comments

Comments
 (0)