Skip to content

Commit

Permalink
Make binary ops left assoc
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvank committed Oct 15, 2024
1 parent 8635398 commit 335bbf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser/expr/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ parser_node *parse_expr_prec(typed_token **tkns_ptr, parser_node *lhs, int min_p
while (1)
{
int look_prec = op_prec(tkn->type_id);
if (look_prec < prec)
if (look_prec <= prec) // <= for left assoc and < for right assoc
{
break;
}
Expand Down

0 comments on commit 335bbf1

Please sign in to comment.