1
1
Fork 0
mirror of https://github.com/azur1s/bobbylisp.git synced 2024-10-16 02:37:40 -05:00

use delimited_by instead

This commit is contained in:
Natapat Samutpong 2022-03-19 08:56:06 +07:00
parent 419d152cf7
commit 8c63304acf

View file

@ -251,13 +251,13 @@ fn expr_parser() -> impl Parser<Token, Vec<Spanned<Expr>>, Error = Simple<Token>
)
});
let do_block = just(Token::KwDo)
.ignore_then(
expr.clone()
let do_block = expr.clone()
.then_ignore(just(Token::SemiColon))
.repeated()
.delimited_by(
just(Token::KwDo),
just(Token::KwEnd),
)
.then_ignore(just(Token::KwEnd))
.map_with_span(|body, span| {
(
Expr::Do {