From bb26d9e674c5c21d3665cbdcbb1666f4c5a4b071 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Fri, 19 Nov 2021 10:00:16 -0800 Subject: [PATCH] Force program() to consume all input --- schala-lang/src/parsing/combinator.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schala-lang/src/parsing/combinator.rs b/schala-lang/src/parsing/combinator.rs index 3db803d..18bea8d 100644 --- a/schala-lang/src/parsing/combinator.rs +++ b/schala-lang/src/parsing/combinator.rs @@ -115,6 +115,7 @@ pub fn program(input: Span) -> ParseResult { //TODO `rest` should be empty let (rest, statements) = context( "AST", + terminated( map( tuple(( many0(statement_delimiter), @@ -122,7 +123,7 @@ pub fn program(input: Span) -> ParseResult { many0(statement_delimiter), )), |(_, items, _)| items.into(), - ), + ), tok(eof)), )(input)?; let ast = AST { id, statements };