Get rid of the concept of NamedBlock and replace it with a ParameterizedBlock special case that does not support an else block.

This commit is contained in:
Tom Alexander
2020-05-30 14:39:31 -04:00
parent eb0eb8d4ca
commit add77cf6a5
3 changed files with 95 additions and 97 deletions

View File

@@ -97,7 +97,7 @@ fn extract_inline_partials_from_tag<'a, 'b>(
}
DustTag::DTPartial(..) => (),
DustTag::DTInlinePartial(named_block) => {
blocks.insert(&named_block.name, &named_block.contents);
blocks.insert(&named_block.path.keys[0], &named_block.contents);
}
DustTag::DTBlock(..) => (),
DustTag::DTHelperEquals(parameterized_block) => {

View File

@@ -347,7 +347,7 @@ impl<'a> DustRenderer<'a> {
None,
&named_block.explicit_context,
);
return match blocks.blocks.get_block(named_block.name) {
return match blocks.blocks.get_block(named_block.path.keys[0]) {
None => self.render_maybe_body(
&named_block.contents,
new_breadcrumbs.as_ref().unwrap_or(breadcrumbs),