diff --git a/src/renderer/inline_partial_tree.rs b/src/renderer/inline_partial_tree.rs index bf328c6..7c74c3f 100644 --- a/src/renderer/inline_partial_tree.rs +++ b/src/renderer/inline_partial_tree.rs @@ -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>, ) { + 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>>, + tag: &'a DustTag, +) { + match tag { + DustTag::DTComment(..) => (), + _ => (), // TODO: Implement the rest + } }