Skip to content

Instantly share code, notes, and snippets.

@Simn
Last active August 29, 2015 13:57
Show Gist options
  • Save Simn/9640418 to your computer and use it in GitHub Desktop.
Save Simn/9640418 to your computer and use it in GitHub Desktop.
hxtemplo config parsing example
-cp src
-main Main
-lib hxtemplo
--interp
class Main {
public static function main () {
var cfgString = "{
'someValue': ::(values.width-305)/2 + values.height::,
'constantValue': 13
}";
var template = new templo.Template(new haxe.io.StringInput(cfgString));
var values = {
width: 500,
height: 1
};
trace(template.execute({values: values}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment