From e0a4ea16752a6df1d1da4984c27e34f1e5c80d38 Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 15 Mar 2020 00:57:22 -0700 Subject: [PATCH] Use tag in block --- schala-lang/language/src/parser.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/schala-lang/language/src/parser.rs b/schala-lang/language/src/parser.rs index 4990190..704e05d 100644 --- a/schala-lang/language/src/parser.rs +++ b/schala-lang/language/src/parser.rs @@ -345,13 +345,12 @@ fn expr_or_block(text: &str) -> ParseResult { } fn block(text: &str) -> ParseResult { - use nom::character::complete::char; //TODO fix this so it can handle nested statements - delimited(ws(char('{')), + delimited(ws(tag("{")), separated_nonempty_list(statement_sep, map(expression, |e| Statement { id: ItemId::new(0), kind: StatementKind::Expression(e) }) ), - ws(char('}')))(text) + ws(tag("}")))(text) } fn call_expr(text: &str) -> ParseResult {