Getting down to the extract_inline_partials_from_tag function.

This commit is contained in:
Tom Alexander 2020-05-09 21:09:46 -04:00
parent 97e806a968
commit ae74ce411a
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -1,5 +1,7 @@
use crate::parser::Body;
use crate::parser::DustTag;
use crate::parser::Template;
use crate::parser::TemplateElement;
use std::collections::HashMap;
struct InlinePartialTreeElement<'a> {
@ -30,4 +32,23 @@ fn extract_inline_partials_from_body<'a, 'b>(
blocks: &'b mut HashMap<&'a str, &'a Option<Body<'a>>>,
body: &'a Body<'a>,
) {
for elem in &body.elements {
match elem {
TemplateElement::TEIgnoredWhitespace(_) => (),
TemplateElement::TESpan(span) => (),
TemplateElement::TETag(dt) => {
extract_inline_partials_from_tag(blocks, dt);
}
}
}
}
fn extract_inline_partials_from_tag<'a, 'b>(
blocks: &'b mut HashMap<&'a str, &'a Option<Body<'a>>>,
tag: &'a DustTag,
) {
match tag {
DustTag::DTComment(..) => (),
_ => (), // TODO: Implement the rest
}
}