Created
May 18, 2010 18:20
-
-
Save wandernauta/405330 to your computer and use it in GitHub Desktop.
This file contains 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
import io/File | |
import mustang/[Parser, Renderer, Context, Value] | |
parser := TemplateParser getParserFromFile(File new("hashmaps-in-hashmaps.tpl")) | |
rootNode := parser parse() | |
context := Context new() | |
somefile := HashValue new() | |
somefile setString("name", "Asdf") | |
somedir := HashValue new() | |
somedir setValue("somefile", somefile) | |
somedir setString("dirname", "Dirry") | |
context setValue("somedir", somedir) | |
context setString("somestr", "asdfasdf") | |
Renderer new(rootNode) render(context) println() |
This file contains 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
Somedir: {{ somedir }} | |
Somedir dirname: {{ somedir dirname }} | |
{{ somestr }} |
This file contains 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
Somedir: Hash | |
Somedir dirname: Hash | |
asdfasdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment