Skip to content

Commit 53d1ee7

Browse files
kai-matsudatekddnewton
authored andcommitted
Use PM_BINDING_POWER_COMPOSITION for the conditional predicate floor
The `+ 1` form is meant to express associativity, not a binding-power floor; use the named constant instead, matching while/until conditions.
1 parent 0fa8d8f commit 53d1ee7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/prism.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15486,7 +15486,7 @@ parse_conditional(pm_parser_t *parser, pm_context_t context, size_t opening_newl
1548615486
pm_token_t keyword = parser->previous;
1548715487
pm_token_t then_keyword = { 0 };
1548815488

15489-
pm_node_t *predicate = parse_predicate(parser, PM_BINDING_POWER_MODIFIER + 1, context, &then_keyword, (uint16_t) (depth + 1));
15489+
pm_node_t *predicate = parse_predicate(parser, PM_BINDING_POWER_COMPOSITION, context, &then_keyword, (uint16_t) (depth + 1));
1549015490
pm_statements_node_t *statements = NULL;
1549115491

1549215492
if (!match3(parser, PM_TOKEN_KEYWORD_ELSIF, PM_TOKEN_KEYWORD_ELSE, PM_TOKEN_KEYWORD_END)) {
@@ -15524,7 +15524,7 @@ parse_conditional(pm_parser_t *parser, pm_context_t context, size_t opening_newl
1552415524
pm_token_t elsif_keyword = parser->current;
1552515525
parser_lex(parser);
1552615526

15527-
pm_node_t *predicate = parse_predicate(parser, PM_BINDING_POWER_MODIFIER + 1, PM_CONTEXT_ELSIF, &then_keyword, (uint16_t) (depth + 1));
15527+
pm_node_t *predicate = parse_predicate(parser, PM_BINDING_POWER_COMPOSITION, PM_CONTEXT_ELSIF, &then_keyword, (uint16_t) (depth + 1));
1552815528
pm_accepts_block_stack_push(parser, true);
1552915529

1553015530
pm_statements_node_t *statements = parse_statements(parser, PM_CONTEXT_ELSIF, (uint16_t) (depth + 1));

0 commit comments

Comments
 (0)