Check the exit matcher in more places.
This commit is contained in:
parent
3502a31b28
commit
ceb7788cfa
@ -3,6 +3,7 @@ use nom::bytes::complete::tag;
|
|||||||
use nom::character::complete::line_ending;
|
use nom::character::complete::line_ending;
|
||||||
use nom::character::complete::space1;
|
use nom::character::complete::space1;
|
||||||
use nom::combinator::eof;
|
use nom::combinator::eof;
|
||||||
|
use nom::combinator::not;
|
||||||
use nom::combinator::recognize;
|
use nom::combinator::recognize;
|
||||||
use nom::multi::many1;
|
use nom::multi::many1;
|
||||||
use nom::multi::many1_count;
|
use nom::multi::many1_count;
|
||||||
@ -63,6 +64,7 @@ impl<'s> Source<'s> for DocumentElement<'s> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn document(input: &str) -> Res<&str, Document> {
|
pub fn document(input: &str) -> Res<&str, Document> {
|
||||||
let initial_context: ContextTree<'_, '_> = ContextTree::new();
|
let initial_context: ContextTree<'_, '_> = ContextTree::new();
|
||||||
let document_context =
|
let document_context =
|
||||||
@ -78,6 +80,7 @@ fn section<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Sec
|
|||||||
exit_matcher: ChainBehavior::AndParent(Some(§ion_end)),
|
exit_matcher: ChainBehavior::AndParent(Some(§ion_end)),
|
||||||
}))
|
}))
|
||||||
.with_additional_node(ContextElement::Context("section"));
|
.with_additional_node(ContextElement::Context("section"));
|
||||||
|
not(|i| parser_context.check_exit_matcher(i))(input)?;
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,6 +90,8 @@ fn section_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn heading<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Heading<'s>> {
|
fn heading<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Heading<'s>> {
|
||||||
|
not(|i| context.check_exit_matcher(i))(input)?;
|
||||||
|
let (remaining, (star_count, _ws, title, _ws2)) = headline(context, input)?;
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
use nom::combinator::not;
|
||||||
|
|
||||||
use super::error::Res;
|
use super::error::Res;
|
||||||
use super::source::Source;
|
use super::source::Source;
|
||||||
use super::Context;
|
use super::Context;
|
||||||
@ -38,5 +40,6 @@ pub fn standard_set_object<'r, 's>(
|
|||||||
context: Context<'r, 's>,
|
context: Context<'r, 's>,
|
||||||
input: &'s str,
|
input: &'s str,
|
||||||
) -> Res<&'s str, Object<'s>> {
|
) -> Res<&'s str, Object<'s>> {
|
||||||
|
not(|i| context.check_exit_matcher(i))(input)?;
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user