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,60 @@
---
source: tests/file_tests.rs
expression: ast
input_file: tests/cases/if_else_if.nomo
---
TemplateAst {
root: [
ConditionalChain {
chain: [
Block {
prev_whitespace_content: None,
expression: IfConditional {
expression: VariableAccess(
[Ident]"test" (6..10),
),
},
post_whitespace_content: Some(
[Whitespace]"\n " (13..18),
),
},
ConditionalContent {
content: [
StaticContent(
[Content]"Not Hello World! :C" (18..37),
),
],
},
Block {
prev_whitespace_content: Some(
[Whitespace]"\n" (37..38),
),
expression: ElseConditional {
expression: Some(
VariableAccess(
[Ident]"another_test" (49..61),
),
),
},
post_whitespace_content: Some(
[Whitespace]"\n " (64..69),
),
},
ConditionalContent {
content: [
StaticContent(
[Content]"Hello World!" (69..81),
),
],
},
Block {
prev_whitespace_content: Some(
[Whitespace]"\n" (81..82),
),
expression: EndBlock,
post_whitespace_content: None,
},
],
},
],
}