Move section into a DustTag as opposed to a top-level block element
This commit is contained in:
parent
5a0b3abf0e
commit
adf2f1f2b5
@ -22,6 +22,7 @@ enum DustTag<'a> {
|
|||||||
DTSpecial(Special),
|
DTSpecial(Special),
|
||||||
DTComment(Comment<'a>),
|
DTComment(Comment<'a>),
|
||||||
DTReference(Reference<'a>),
|
DTReference(Reference<'a>),
|
||||||
|
DTSection(Section<'a>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
@ -85,7 +86,6 @@ pub struct Template<'a> {
|
|||||||
enum TemplateElement<'a> {
|
enum TemplateElement<'a> {
|
||||||
TESpan(Span<'a>),
|
TESpan(Span<'a>),
|
||||||
TETag(DustTag<'a>),
|
TETag(DustTag<'a>),
|
||||||
TESection(Section<'a>),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dust_tag(i: &str) -> IResult<&str, DustTag> {
|
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(special, DustTag::DTSpecial),
|
||||||
map(comment, DustTag::DTComment),
|
map(comment, DustTag::DTComment),
|
||||||
map(reference, DustTag::DTReference),
|
map(reference, DustTag::DTReference),
|
||||||
|
map(section, DustTag::DTSection),
|
||||||
))(i)
|
))(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +184,6 @@ fn block(i: &str) -> IResult<&str, Block> {
|
|||||||
let (remaining, template_elements) = many1(alt((
|
let (remaining, template_elements) = many1(alt((
|
||||||
map(span, TemplateElement::TESpan),
|
map(span, TemplateElement::TESpan),
|
||||||
map(dust_tag, TemplateElement::TETag),
|
map(dust_tag, TemplateElement::TETag),
|
||||||
map(section, TemplateElement::TESection),
|
|
||||||
)))(i)?;
|
)))(i)?;
|
||||||
Ok((
|
Ok((
|
||||||
remaining,
|
remaining,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user