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 //TODO `rest` should be empty
let (rest, statements) = context( let (rest, statements) = context(
"AST", "AST",
terminated(
map( map(
tuple(( tuple((
many0(statement_delimiter), many0(statement_delimiter),
@ -122,7 +123,7 @@ pub fn program(input: Span) -> ParseResult<AST> {
many0(statement_delimiter), many0(statement_delimiter),
)), )),
|(_, items, _)| items.into(), |(_, items, _)| items.into(),
), ), tok(eof)),
)(input)?; )(input)?;
let ast = AST { id, statements }; let ast = AST { id, statements };