Move section into a DustTag as opposed to a top-level block element

master
Tom Alexander 4 years ago
parent 5a0b3abf0e
commit adf2f1f2b5
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -22,6 +22,7 @@ enum DustTag<'a> {
DTSpecial(Special),
DTComment(Comment<'a>),
DTReference(Reference<'a>),
DTSection(Section<'a>),
}
#[derive(Clone, Debug, PartialEq)]
@ -85,7 +86,6 @@ pub struct Template<'a> {
enum TemplateElement<'a> {
TESpan(Span<'a>),
TETag(DustTag<'a>),
TESection(Section<'a>),
}
fn dust_tag(i: &str) -> IResult<&str, DustTag> {
@ -93,6 +93,7 @@ fn dust_tag(i: &str) -> IResult<&str, DustTag> {
map(special, DustTag::DTSpecial),
map(comment, DustTag::DTComment),
map(reference, DustTag::DTReference),
map(section, DustTag::DTSection),
))(i)
}
@ -183,7 +184,6 @@ fn block(i: &str) -> IResult<&str, Block> {
let (remaining, template_elements) = many1(alt((
map(span, TemplateElement::TESpan),
map(dust_tag, TemplateElement::TETag),
map(section, TemplateElement::TESection),
)))(i)?;
Ok((
remaining,

Loading…
Cancel
Save