new line for sum/product works
This commit is contained in:
parent
8ce2b5aad2
commit
de63467730
1 changed files with 2 additions and 0 deletions
|
|
@ -50,6 +50,7 @@ where
|
||||||
just(Token::Divide).to(BinaryOp::Divide),
|
just(Token::Divide).to(BinaryOp::Divide),
|
||||||
))
|
))
|
||||||
.then(atom)
|
.then(atom)
|
||||||
|
.then_ignore(just(Token::NewLine).or_not())
|
||||||
.repeated(),
|
.repeated(),
|
||||||
|lhs, (op, rhs)| Expr::Binary {
|
|lhs, (op, rhs)| Expr::Binary {
|
||||||
lhs: Box::new(lhs),
|
lhs: Box::new(lhs),
|
||||||
|
|
@ -64,6 +65,7 @@ where
|
||||||
just(Token::Substract).to(BinaryOp::Substract),
|
just(Token::Substract).to(BinaryOp::Substract),
|
||||||
))
|
))
|
||||||
.then(mul_div)
|
.then(mul_div)
|
||||||
|
.then_ignore(just(Token::NewLine).or_not())
|
||||||
.repeated(),
|
.repeated(),
|
||||||
|lhs, (op, rhs)| Expr::Binary {
|
|lhs, (op, rhs)| Expr::Binary {
|
||||||
lhs: Box::new(lhs),
|
lhs: Box::new(lhs),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue