Add a noop if no whitespace is emitted to have something to jump to

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-09 13:33:52 +01:00
parent 59f92e31fe
commit e0e84ede1c
6 changed files with 16 additions and 11 deletions

View file

@ -45,6 +45,7 @@ pub enum Instruction {
Jump {
jump: isize,
},
NoOp,
}
pub fn emit_machine(input: crate::ast::TemplateAst<'_>) -> Vec<Instruction> {
@ -185,6 +186,8 @@ fn emit_ast_expr(
eval.push(Instruction::AppendContent {
content: ws.source().clone(),
});
} else {
eval.push(Instruction::NoOp);
}
for index in end_indices {