Get tracing back into the element parser.

This commit is contained in:
Tom Alexander 2023-04-22 19:15:29 -04:00
parent f70babdcf4
commit 0b3f414ecf
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 74 additions and 67 deletions

View File

@ -33,7 +33,15 @@ use nom::multi::many0;
pub fn element(
can_be_paragraph: bool,
) -> impl for<'r, 's> Fn(Context<'r, 's>, &'s str) -> Res<&'s str, Element<'s>> {
move |context: Context, input: &str| {
move |context: Context, input: &str| _element(context, input, can_be_paragraph)
}
#[tracing::instrument(ret, level = "debug")]
fn _element<'r, 's>(
context: Context<'r, 's>,
input: &'s str,
can_be_paragraph: bool,
) -> Res<&'s str, Element<'s>> {
let plain_list_matcher = parser_with_context!(plain_list)(context);
let greater_block_matcher = parser_with_context!(greater_block)(context);
let dynamic_block_matcher = parser_with_context!(dynamic_block)(context);
@ -100,4 +108,3 @@ pub fn element(
Ok((remaining, element))
}
}