Introduce JumpLabels instead of manually correct jump positions
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
e64256b65f
commit
7182024342
12 changed files with 485 additions and 381 deletions
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue