Add deep access
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
4f770c1f24
commit
ffd9baf90f
9 changed files with 669 additions and 5 deletions
74
tests/cases/deep_access.1-parsed.snap
Normal file
74
tests/cases/deep_access.1-parsed.snap
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
---
|
||||
source: tests/file_tests.rs
|
||||
expression: parsed
|
||||
info:
|
||||
input: "{{ if world?.active }}\nHello {{= world.name }}\n{{ end }}\n\n{{ if world?.foo?.bar?.active }}\n Weird!\n{{ else }}\n Deep access is working :)\n{{ end }}"
|
||||
context:
|
||||
world:
|
||||
active: true
|
||||
name: World!
|
||||
---
|
||||
ParsedTemplate {
|
||||
tokens: [
|
||||
[LeftDelim]"{{" (0..2),
|
||||
[Whitespace]" " (2..3),
|
||||
[ConditionalIf]"if" (3..5),
|
||||
[Whitespace]" " (5..6),
|
||||
[Ident]"world" (6..11),
|
||||
[Operator(QuestionMark)]"?" (11..12),
|
||||
[Operator(Dot)]"." (12..13),
|
||||
[Ident]"active" (13..19),
|
||||
[Whitespace]" " (19..20),
|
||||
[RightDelim]"}}" (20..22),
|
||||
[Whitespace]"\n" (22..23),
|
||||
[Content]"Hello" (23..28),
|
||||
[Whitespace]" " (28..29),
|
||||
[LeftDelim]"{{" (29..31),
|
||||
[WantsOutput]"=" (31..32),
|
||||
[Whitespace]" " (32..33),
|
||||
[Ident]"world" (33..38),
|
||||
[Operator(Dot)]"." (38..39),
|
||||
[Ident]"name" (39..43),
|
||||
[Whitespace]" " (43..44),
|
||||
[RightDelim]"}}" (44..46),
|
||||
[Whitespace]"\n" (46..47),
|
||||
[LeftDelim]"{{" (47..49),
|
||||
[Whitespace]" " (49..50),
|
||||
[End]"end" (50..53),
|
||||
[Whitespace]" " (53..54),
|
||||
[RightDelim]"}}" (54..56),
|
||||
[Whitespace]"\n\n" (56..58),
|
||||
[LeftDelim]"{{" (58..60),
|
||||
[Whitespace]" " (60..61),
|
||||
[ConditionalIf]"if" (61..63),
|
||||
[Whitespace]" " (63..64),
|
||||
[Ident]"world" (64..69),
|
||||
[Operator(QuestionMark)]"?" (69..70),
|
||||
[Operator(Dot)]"." (70..71),
|
||||
[Ident]"foo" (71..74),
|
||||
[Operator(QuestionMark)]"?" (74..75),
|
||||
[Operator(Dot)]"." (75..76),
|
||||
[Ident]"bar" (76..79),
|
||||
[Operator(QuestionMark)]"?" (79..80),
|
||||
[Operator(Dot)]"." (80..81),
|
||||
[Ident]"active" (81..87),
|
||||
[Whitespace]" " (87..88),
|
||||
[RightDelim]"}}" (88..90),
|
||||
[Whitespace]"\n " (90..95),
|
||||
[Content]"Weird!" (95..101),
|
||||
[Whitespace]"\n" (101..102),
|
||||
[LeftDelim]"{{" (102..104),
|
||||
[Whitespace]" " (104..105),
|
||||
[ConditionalElse]"else" (105..109),
|
||||
[Whitespace]" " (109..110),
|
||||
[RightDelim]"}}" (110..112),
|
||||
[Whitespace]"\n " (112..117),
|
||||
[Content]"Deep access is working :)" (117..142),
|
||||
[Whitespace]"\n" (142..143),
|
||||
[LeftDelim]"{{" (143..145),
|
||||
[Whitespace]" " (145..146),
|
||||
[End]"end" (146..149),
|
||||
[Whitespace]" " (149..150),
|
||||
[RightDelim]"}}" (150..152),
|
||||
],
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue