Hmmm it seems to be building.

This commit is contained in:
Tom Alexander
2022-07-16 21:32:23 -04:00
parent 99b19410c5
commit 8357837571
4 changed files with 44 additions and 31 deletions

View File

@@ -1,4 +1,7 @@
//! A single element of text.
use crate::parser::parser_with_context::parser_with_context;
use crate::parser::text::paragraph_end;
use super::nom_context::NomContext;
// use super::parser_with_context::parser_with_context;
use super::text::line_break;
@@ -11,6 +14,7 @@ use nom::branch::alt;
use nom::combinator::map;
use nom::combinator::not;
use nom::error::VerboseError;
use nom::multi::many_till;
use nom::IResult;
// parser_with_context!(text_element, TextElement, i, context, {
@@ -48,3 +52,9 @@ where
// todo
todo!()
}
pub fn paragraph(input: &str) -> Res<&str, (Vec<TextElement>, &str)> {
let initial_context = NomContext::new(&paragraph_end);
let text_element_parser = parser_with_context!(flat_text_element)(initial_context);
many_till(text_element_parser, paragraph_end)(input)
}