Safe Haskell | None |
---|---|
Language | Haskell2010 |
Implements Ginger's Abstract Syntax Tree.
Documentation
Top-level data structure, representing a fully parsed template.
A macro definition ( {% macro %}
)
Ginger statements.
MultiS [Statement] | A sequence of multiple statements |
ScopedS Statement | Run wrapped statement in a local scope |
LiteralS Html | Literal output (anything outside of any tag) |
InterpolationS Expression | {{ expression }} |
IfS Expression Statement Statement | {% if expression %}statement{% else %}statement{% endif %} |
ForS (Maybe VarName) VarName Expression Statement | {% for index, varname in expression %}statement{% endfor %} |
SetVarS VarName Expression | {% set varname = expr %} |
DefMacroS VarName Macro | {% macro varname %}statements{% endmacro %} |
BlockRefS VarName | |
PreprocessedIncludeS Template | {% include "template" %} |
NullS | The do-nothing statement (NOP) |
data Expression Source
Expressions, building blocks for the expression minilanguage.
StringLiteralE Text | String literal expression: "foobar" |
NumberLiteralE Scientific | Numeric literal expression: 123.4 |
BoolLiteralE Bool | Boolean literal expression: true |
NullLiteralE | Literal null |
VarE VarName | Variable reference: foobar |
ListE [Expression] | List construct: [ expr, expr, expr ] |
ObjectE [(Expression, Expression)] | Object construct: { expr: expr, expr: expr, ... } |
MemberLookupE Expression Expression | foo[bar] (also dot access) |
CallE Expression [(Maybe Text, Expression)] | foo(bar=baz, quux) |