Also fix the jump if its the last one

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-09 13:04:16 +01:00
parent ff308649b9
commit ae379df9db
7 changed files with 185 additions and 2 deletions

View file

@ -0,0 +1,61 @@
---
source: tests/file_tests.rs
expression: emit
input_file: tests/cases/if_else_if.nomo
---
[
LoadFromContextToSlot {
name: "test" (6..10),
slot: VariableSlot {
index: 0,
},
},
JumpIfNotTrue {
emit_slot: VariableSlot {
index: 0,
},
jump: 5,
},
AppendContent {
content: "\n " (13..18),
},
AppendContent {
content: "Not Hello World! :C" (18..37),
},
Jump {
jump: 9,
},
AppendContent {
content: "\n " (13..18),
},
AppendContent {
content: "\n" (37..38),
},
LoadFromContextToSlot {
name: "another_test" (49..61),
slot: VariableSlot {
index: 1,
},
},
JumpIfNotTrue {
emit_slot: VariableSlot {
index: 1,
},
jump: 5,
},
AppendContent {
content: "\n " (64..69),
},
AppendContent {
content: "Hello World!" (69..81),
},
Jump {
jump: 2,
},
AppendContent {
content: "\n " (64..69),
},
AppendContent {
content: "\n" (81..82),
},
]