Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/prism.c
Original file line number Diff line number Diff line change
Expand Up @@ -13423,7 +13423,13 @@ parse_targets(pm_parser_t *parser, pm_node_t *first_target, pm_binding_power_t b
static pm_node_t *
parse_targets_validate(pm_parser_t *parser, pm_node_t *first_target, pm_binding_power_t binding_power, uint16_t depth) {
pm_node_t *result = parse_targets(parser, first_target, binding_power, depth);
accept1(parser, PM_TOKEN_NEWLINE);

// If we're inside parentheses, then we allow a newline before the
// closing parenthesis or equals sign. Outside of parentheses, a newline
// is not allowed (e.g., `a, b\n= 1, 2` is not valid).
if (context_p(parser, PM_CONTEXT_PARENS) || context_p(parser, PM_CONTEXT_MULTI_TARGET)) {
accept1(parser, PM_TOKEN_NEWLINE);
}

// Ensure that we have either an = or a ) after the targets.
if (!match2(parser, PM_TOKEN_EQUAL, PM_TOKEN_PARENTHESIS_RIGHT)) {
Expand Down