Move EndBlock to own element

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-08 20:10:33 +01:00
parent 08b480705b
commit 383f543119
4 changed files with 38 additions and 43 deletions

View file

@ -93,7 +93,6 @@ fn emit_ast_expr(
let Some(TemplateAstExpr::IfConditional {
if_block: expression,
content,
end_block,
}) = chain.next()
else {
unreachable!("First element in conditional chain should be an IfConditional");
@ -133,13 +132,13 @@ fn emit_ast_expr(
emit_ast_expr(machine, eval, ast);
}
let TemplateAstExpr::Block {
let Some(TemplateAstExpr::Block {
prev_whitespace_content,
post_whitespace_content,
..
} = end_block.as_ref()
}) = chain.last()
else {
unreachable!("The end of an IfConditional must be a Block");
unreachable!("The end of an IfConditional must be a End Block");
};
if let Some(ws) = prev_whitespace_content {