diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index 20ad8ea..2480939 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -251,13 +251,13 @@ fn expr_parser() -> impl Parser>, Error = Simple ) }); - let do_block = just(Token::KwDo) - .ignore_then( - expr.clone() - .then_ignore(just(Token::SemiColon)) - .repeated() + 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 {