|
|
|
@ -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,
|
|
|
|
|