Commit Graph

4 Commits

Author SHA1 Message Date
Martin Atkins
e594a232b3 zclsyntax: change template control sequence introducer to %{
Previously it was !{, but in real examples this looked confusing since
an exclamation point after a word looks (to humans) like literal
punctuation rather than syntax.

% is not ideal either since it's also the marker traditionally used for
printf, but has the advantage that programmers are already primed for it
to be syntax.
2017-06-17 18:33:56 -07:00
Martin Atkins
15e3d80e6c zclsyntax: parsing of template if construct
Since this ultimately just returns a ConditionalExpr, the evaluation is
already implemented too.
2017-06-17 10:07:59 -07:00
Martin Atkins
302487ce0f zclsyntax: template interpolation trimming
The ~ character can be used at the start and end of interpolation
sequences to trim off whitespace in neighboring literals, with the goal
of allowing extra whitespace to be included for readability without
including it in the resulting string.
2017-06-01 08:43:59 -07:00
Martin Atkins
8004488042 zclsyntax: public-facing ParseTemplate function
This allows calling applications to deal with bare templates, e.g. loaded
from separate files referenced in a main configuration.
2017-06-01 08:10:04 -07:00