Add conditional value emitting

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-15 12:46:00 +01:00
parent 662e574588
commit 9940881e46
10 changed files with 82 additions and 11 deletions

View file

@ -4,8 +4,8 @@ expression: emit
info:
input: "{{ if test -}}\n Hello {{= stuff -}}\n{{- end }}"
context:
stuff: Hemera
test: true
stuff: Hemera
---
VMInstructions {
labels: {
@ -22,6 +22,7 @@ VMInstructions {
slot: VariableSlot {
index: 1,
},
fail_on_not_found: true,
},
JumpIfNotTrue {
emit_slot: VariableSlot {
@ -42,6 +43,7 @@ VMInstructions {
slot: VariableSlot {
index: 3,
},
fail_on_not_found: true,
},
EmitFromSlot {
slot: VariableSlot {