Add parsing for conditionals (cont.)
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
974086a877
commit
8afc2d1bde
29 changed files with 994 additions and 746 deletions
45
tests/cases/2-ast@condition.snap
Normal file
45
tests/cases/2-ast@condition.snap
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: ast
|
||||
input_file: tests/cases/condition.nomo
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
ConditionalChain {
|
||||
chain: [
|
||||
IfConditional {
|
||||
if_block: Block {
|
||||
prev_whitespace_content: None,
|
||||
expression: VariableAccess(
|
||||
"test" (6..10),
|
||||
),
|
||||
post_whitespace_content: Some(
|
||||
"\n " (13..18),
|
||||
),
|
||||
},
|
||||
content: [
|
||||
StaticContent(
|
||||
"Hello World!" (18..30),
|
||||
),
|
||||
],
|
||||
end_block: Block {
|
||||
prev_whitespace_content: Some(
|
||||
"\n" (30..31),
|
||||
),
|
||||
expression: EndBlock,
|
||||
post_whitespace_content: Some(
|
||||
"\n\n" (40..42),
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
Interpolation {
|
||||
prev_whitespace_content: None,
|
||||
expression: VariableAccess(
|
||||
"stuff" (46..51),
|
||||
),
|
||||
post_whitespace_content: None,
|
||||
},
|
||||
],
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue