Operators associate to the left now
This should be default behaviour but somehow we missed it.
This commit is contained in:
parent
00b11087b4
commit
3b1500313c
@ -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");
|
assert(not expect(Token::Type::Operator, "."), "This should be handled by parse_index_expression");
|
||||||
auto op = consume();
|
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));
|
lhs.arguments.emplace_back(std::move(rhs));
|
||||||
Ast ast;
|
Ast ast;
|
||||||
ast.location = op.location;
|
ast.location = op.location;
|
||||||
|
Loading…
Reference in New Issue
Block a user