Operators associate to the left now

This should be default behaviour but somehow we missed it.
This commit is contained in:
Robert Bendun 2022-09-04 12:04:19 +02:00
parent 00b11087b4
commit 3b1500313c

View File

@ -161,7 +161,7 @@ Result<Ast> Parser::parse_rhs_of_infix_expression(Ast lhs)
assert(not expect(Token::Type::Operator, "."), "This should be handled by parse_index_expression");
auto op = consume();
if (precedense(lhs.token.source) > precedense(op.source)) {
if (precedense(lhs.token.source) >= precedense(op.source)) {
lhs.arguments.emplace_back(std::move(rhs));
Ast ast;
ast.location = op.location;