Getting down to the extract_inline_partials_from_tag function.
This commit is contained in:
parent
97e806a968
commit
ae74ce411a
@ -1,5 +1,7 @@
|
|||||||
use crate::parser::Body;
|
use crate::parser::Body;
|
||||||
|
use crate::parser::DustTag;
|
||||||
use crate::parser::Template;
|
use crate::parser::Template;
|
||||||
|
use crate::parser::TemplateElement;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
struct InlinePartialTreeElement<'a> {
|
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>>>,
|
blocks: &'b mut HashMap<&'a str, &'a Option<Body<'a>>>,
|
||||||
body: &'a 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user