Trace span events.

This commit is contained in:
Tom Alexander
2022-11-25 17:54:26 -05:00
parent 1fcb32d3c6
commit cdb35edd64
2 changed files with 6 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ use nom::multi::many1;
use nom::multi::many_till;
use nom::sequence::tuple;
use nom::IResult;
use tracing::instrument;
use super::nom_context::ContextTree;
use super::nom_context::OrgModeContextTree;
@@ -137,6 +138,7 @@ pub fn paragraph_end(input: &str) -> Res<&str, &str> {
recognize(tuple((map(line_break, TextElement::LineBreak), blank_line)))(input)
}
#[instrument]
pub fn document(input: &str) -> Res<&str, Vec<(Vec<TextElement>, &str)>> {
let initial_context = ContextTree::new();
let paragraph_context = initial_context.with_additional_fail_matcher(&paragraph_end);