From e5b6f2bc2fbb1b7cfac3ce4227ebc32b2362bc0d Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sat, 20 Nov 2021 20:55:26 -0800 Subject: [PATCH] Delimiter --- schala-lang/src/parsing/combinator.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/schala-lang/src/parsing/combinator.rs b/schala-lang/src/parsing/combinator.rs index 454115b..2d1b9c6 100644 --- a/schala-lang/src/parsing/combinator.rs +++ b/schala-lang/src/parsing/combinator.rs @@ -153,17 +153,10 @@ pub fn program(input: Span) -> ParseResult { fn block_template<'a, O>( input_parser: impl Parser, O, VerboseError>>, ) -> impl FnMut(Span<'a>) -> IResult, Vec, VerboseError>> { - map( - delimited( - tok(char('{')), - tuple(( - many0(statement_delimiter), - separated_list0(many1(statement_delimiter), input_parser), - many0(statement_delimiter), - )), - tok(char('}')), - ), - |(_, items, _)| items, + delimited( + pair(tok(char('{')), many0(statement_delimiter)), + separated_list0(many1(statement_delimiter), input_parser), + pair(many0(statement_delimiter), tok(char('}'))), ) }