From 54b0ff50362d446cd5f6c98167620779659db92e Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 10 Apr 2023 10:50:42 -0400 Subject: [PATCH] Check for whitespace eof in exit matcher. --- src/parser/parser_context.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/parser_context.rs b/src/parser/parser_context.rs index 121e6161..2810347b 100644 --- a/src/parser/parser_context.rs +++ b/src/parser/parser_context.rs @@ -3,6 +3,8 @@ use std::rc::Rc; use nom::combinator::eof; use nom::IResult; +use crate::parser::util::whitespace_eof; + use super::error::CustomError; use super::error::MyError; use super::error::Res; @@ -66,7 +68,7 @@ impl<'r, 's> ContextTree<'r, 's> { i: &'s str, ) -> IResult<&'s str, &'s str, CustomError<&'s str>> { // Special check for EOF. We don't just make this a document-level exit matcher since the IgnoreParent ChainBehavior could cause early exit matchers to not run. - let at_end_of_file = eof(i); + let at_end_of_file = whitespace_eof(i); if at_end_of_file.is_ok() { return at_end_of_file; }