From 48cb3c4a023c1805abed765e78038f31cd2ebd78 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Tue, 19 Sep 2023 23:57:40 -0400 Subject: [PATCH] Move the post-colon check into the item_tag_divider parser. --- scripts/run_docker_compare_bisect.bash | 2 +- src/parser/plain_list.rs | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/run_docker_compare_bisect.bash b/scripts/run_docker_compare_bisect.bash index 83635783..e71b340b 100755 --- a/scripts/run_docker_compare_bisect.bash +++ b/scripts/run_docker_compare_bisect.bash @@ -64,7 +64,7 @@ function run_parse { local lines="$1" cd "$SOURCE_FOLDER" - head -n "$lines" "$SOURCE_FOLDER/$TARGET_DOCUMENT" | "${DIR}/run_docker_compare.bash" + head -n "$lines" "$SOURCE_FOLDER/$TARGET_DOCUMENT" | PROFILE=release-lto "${DIR}/run_docker_compare.bash" local status=$? return "$status" } diff --git a/src/parser/plain_list.rs b/src/parser/plain_list.rs index 74a819e9..1ee06ae2 100644 --- a/src/parser/plain_list.rs +++ b/src/parser/plain_list.rs @@ -359,22 +359,22 @@ fn item_tag_end<'b, 'g, 'r, 's>( _context: RefContext<'b, 'g, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { - alt(( - recognize(tuple(( - item_tag_divider, + alt((item_tag_divider, line_ending))(input) +} + +#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] +fn item_tag_divider<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { + recognize(tuple(( + one_of(" \t"), + tag("::"), + peek(tuple(( opt(tuple(( peek(one_of(" \t")), many_till(anychar, peek(alt((item_tag_divider, line_ending, eof)))), ))), alt((line_ending, eof)), ))), - line_ending, - ))(input) -} - -#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] -fn item_tag_divider<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { - recognize(tuple((one_of(" \t"), tag("::"))))(input) + )))(input) } #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]