Introduce JumpLabels instead of manually correct jump positions

Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
Marcel Müller 2026-03-11 15:50:05 +01:00
parent e64256b65f
commit 7182024342
12 changed files with 485 additions and 381 deletions

View file

@ -3,36 +3,39 @@ source: tests/file_tests.rs
expression: emit
input_file: tests/cases/multiple.nomo
---
[
AppendContent {
content: "Hi there! My name is" (0..20),
},
AppendContent {
content: " " (20..21),
},
LoadFromContextToSlot {
name: "name" (25..29),
slot: VariableSlot {
index: 0,
VMInstructions {
labels: {},
instructions: [
AppendContent {
content: "Hi there! My name is" (0..20),
},
},
EmitFromSlot {
slot: VariableSlot {
index: 0,
AppendContent {
content: " " (20..21),
},
},
AppendContent {
content: " " (32..33),
},
LoadFromContextToSlot {
name: "lastname" (37..45),
slot: VariableSlot {
index: 1,
LoadFromContextToSlot {
name: "name" (25..29),
slot: VariableSlot {
index: 0,
},
},
},
EmitFromSlot {
slot: VariableSlot {
index: 1,
EmitFromSlot {
slot: VariableSlot {
index: 0,
},
},
},
]
AppendContent {
content: " " (32..33),
},
LoadFromContextToSlot {
name: "lastname" (37..45),
slot: VariableSlot {
index: 1,
},
},
EmitFromSlot {
slot: VariableSlot {
index: 1,
},
},
],
}