165 lines
3.8 KiB
Text
165 lines
3.8 KiB
Text
---
|
|
source: tests/file_tests.rs
|
|
expression: emit
|
|
info:
|
|
input: "{{ for value in values -}}\n {{-= value }}\n{{- end }}\n{{ for value in no_values -}}\n {{-= value }}\n{{ else -}}\nNo Values >:C\n{{- end }}"
|
|
context:
|
|
no_values: []
|
|
values:
|
|
- one
|
|
- two
|
|
---
|
|
VMInstructions {
|
|
labels: {
|
|
LabelSlot {
|
|
index: 0,
|
|
}: 10,
|
|
LabelSlot {
|
|
index: 1,
|
|
}: 10,
|
|
LabelSlot {
|
|
index: 2,
|
|
}: 4,
|
|
LabelSlot {
|
|
index: 7,
|
|
}: 22,
|
|
LabelSlot {
|
|
index: 8,
|
|
}: 23,
|
|
LabelSlot {
|
|
index: 9,
|
|
}: 16,
|
|
},
|
|
instructions: [
|
|
PushScope {
|
|
inherit_parent: true,
|
|
},
|
|
LoadFromContextToSlot {
|
|
name: "values" (16..22),
|
|
slot: VariableSlot {
|
|
index: 4,
|
|
},
|
|
},
|
|
CreateIteratorFromSlotToSlot {
|
|
iterator_slot: VariableSlot {
|
|
index: 5,
|
|
},
|
|
iterator_source_slot: VariableSlot {
|
|
index: 4,
|
|
},
|
|
},
|
|
GetIteratorEmptyOrJump {
|
|
iterator_slot: VariableSlot {
|
|
index: 5,
|
|
},
|
|
jump: LabelSlot {
|
|
index: 0,
|
|
},
|
|
},
|
|
AdvanceIteratorOrJump {
|
|
iterator_slot: VariableSlot {
|
|
index: 5,
|
|
},
|
|
value_slot: VariableSlot {
|
|
index: 3,
|
|
},
|
|
jump: LabelSlot {
|
|
index: 1,
|
|
},
|
|
},
|
|
LoadFromSlotToContext {
|
|
value_ident: "value" (7..12),
|
|
value_slot: VariableSlot {
|
|
index: 3,
|
|
},
|
|
},
|
|
LoadFromContextToSlot {
|
|
name: "value" (36..41),
|
|
slot: VariableSlot {
|
|
index: 6,
|
|
},
|
|
},
|
|
EmitFromSlot {
|
|
slot: VariableSlot {
|
|
index: 6,
|
|
},
|
|
},
|
|
AppendContent {
|
|
content: "\n" (44..45),
|
|
},
|
|
Jump {
|
|
jump: LabelSlot {
|
|
index: 2,
|
|
},
|
|
},
|
|
PopScope,
|
|
AppendContent {
|
|
content: "\n" (55..56),
|
|
},
|
|
PushScope {
|
|
inherit_parent: true,
|
|
},
|
|
LoadFromContextToSlot {
|
|
name: "no_values" (72..81),
|
|
slot: VariableSlot {
|
|
index: 11,
|
|
},
|
|
},
|
|
CreateIteratorFromSlotToSlot {
|
|
iterator_slot: VariableSlot {
|
|
index: 12,
|
|
},
|
|
iterator_source_slot: VariableSlot {
|
|
index: 11,
|
|
},
|
|
},
|
|
GetIteratorEmptyOrJump {
|
|
iterator_slot: VariableSlot {
|
|
index: 12,
|
|
},
|
|
jump: LabelSlot {
|
|
index: 7,
|
|
},
|
|
},
|
|
AdvanceIteratorOrJump {
|
|
iterator_slot: VariableSlot {
|
|
index: 12,
|
|
},
|
|
value_slot: VariableSlot {
|
|
index: 10,
|
|
},
|
|
jump: LabelSlot {
|
|
index: 8,
|
|
},
|
|
},
|
|
LoadFromSlotToContext {
|
|
value_ident: "value" (63..68),
|
|
value_slot: VariableSlot {
|
|
index: 10,
|
|
},
|
|
},
|
|
LoadFromContextToSlot {
|
|
name: "value" (95..100),
|
|
slot: VariableSlot {
|
|
index: 13,
|
|
},
|
|
},
|
|
EmitFromSlot {
|
|
slot: VariableSlot {
|
|
index: 13,
|
|
},
|
|
},
|
|
AppendContent {
|
|
content: "\n" (103..104),
|
|
},
|
|
Jump {
|
|
jump: LabelSlot {
|
|
index: 9,
|
|
},
|
|
},
|
|
AppendContent {
|
|
content: "No Values >:C" (116..129),
|
|
},
|
|
PopScope,
|
|
],
|
|
}
|