Also fix the jump if its the last one
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
ff308649b9
commit
ae379df9db
7 changed files with 185 additions and 2 deletions
61
tests/cases/3-instructions@if_else_if.snap
Normal file
61
tests/cases/3-instructions@if_else_if.snap
Normal 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),
|
||||
},
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue