Force program() to consume all input

This commit is contained in:
Greg Shuflin 2021-11-19 10:00:16 -08:00
parent 219f5a183a
commit bb26d9e674

View File

@ -115,6 +115,7 @@ pub fn program(input: Span) -> ParseResult<AST> {
//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<AST> {
many0(statement_delimiter),
)),
|(_, items, _)| items.into(),
),
), tok(eof)),
)(input)?;
let ast = AST { id, statements };