From de634677309f4762bb3713a141c3a8b449845743 Mon Sep 17 00:00:00 2001 From: LunarAkai Date: Fri, 8 Aug 2025 20:14:35 +0200 Subject: [PATCH] new line for sum/product works --- src/language_frontend/abstract_syntax_tree/parser.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/language_frontend/abstract_syntax_tree/parser.rs b/src/language_frontend/abstract_syntax_tree/parser.rs index 6453999..c954b8d 100644 --- a/src/language_frontend/abstract_syntax_tree/parser.rs +++ b/src/language_frontend/abstract_syntax_tree/parser.rs @@ -50,6 +50,7 @@ where just(Token::Divide).to(BinaryOp::Divide), )) .then(atom) + .then_ignore(just(Token::NewLine).or_not()) .repeated(), |lhs, (op, rhs)| Expr::Binary { lhs: Box::new(lhs), @@ -64,6 +65,7 @@ where just(Token::Substract).to(BinaryOp::Substract), )) .then(mul_div) + .then_ignore(just(Token::NewLine).or_not()) .repeated(), |lhs, (op, rhs)| Expr::Binary { lhs: Box::new(lhs),