Last active
October 15, 2019 05:00
-
-
Save ndugger/f27d0a95d21585d74cee5ca076bcb1de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn render(condition: bool) -> wjet::Tree { | |
| let bar = false; | |
| wml! { | |
| <Block> { | |
| let foo = false; | |
| let name = "World"; | |
| if (!condition) { | |
| <Block { foo: condition, baz: 7 }> | |
| } else if (foo) { | |
| <Block { foo: true }> | |
| } else { | |
| println!("Hello {}", name); | |
| } | |
| <Block { baz: 72 }> | |
| } | |
| <Block {}> { | |
| // This will render the content 10 times | |
| for x in (0..10) { | |
| <Block { foo: x > 5, baz: 3 }> { | |
| <Block { foo: condition }> | |
| } | |
| <Block { foo: false }> | |
| } | |
| } | |
| <Block { baz: 69 }> { | |
| match (bar) { | |
| true => { | |
| <Block { foo: true }> | |
| }, | |
| false => { | |
| <Block { foo: false }> { | |
| <Block { foo: true }> | |
| <Block { foo: false }> | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment