From 8c63304acf5cba6bf3e284daaa52c6ed6a64543c Mon Sep 17 00:00:00 2001 From: Natapat Samutpong Date: Sat, 19 Mar 2022 08:56:06 +0700 Subject: [PATCH] use `delimited_by` instead --- crates/parser/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 {