Do not consume trailing whitespace if the parent exit matcher is matching.

This commit is contained in:
Tom Alexander
2023-04-10 13:13:11 -04:00
parent 895ee9f3b6
commit 1ecdd61fed
6 changed files with 29 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ use crate::parser::parser_context::ExitMatcherNode;
use crate::parser::parser_with_context::parser_with_context;
use crate::parser::util::exit_matcher_parser;
use crate::parser::util::get_consumed;
use crate::parser::util::maybe_consume_trailing_whitespace;
use crate::parser::util::maybe_consume_trailing_whitespace_if_not_exiting;
use crate::parser::util::start_of_line;
use nom::branch::alt;
use nom::bytes::complete::is_not;
@@ -57,7 +57,8 @@ pub fn greater_block<'r, 's>(
// Not checking if parent exit matcher is causing exit because the greater_block_end matcher asserts we matched a full greater block
let (remaining, _trailing_ws) = maybe_consume_trailing_whitespace(context, remaining)?;
let (remaining, _trailing_ws) =
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
let parameters = match parameters {
Some((_ws, parameters)) => Some(parameters),