TT3: /home/abw/web/london/tt3/slides/examples/fill_block.tt3

Template Source

[% fill message %] [% block message %] Hello [% name or 'World' %]! [% end %] --EOF--

Source Tokens

tag_start@0[%
whitespace@2
command fill@3fill
whitespace@7
filename@8message
whitespace@15
tag_end@16%]
text@18\n\n
tag_start@20[%
whitespace@22
command block@23block
whitespace@28
filename@29message
whitespace@36
tag_end@37%]
text@39\nHello
tag_start@46[%
whitespace@48
variable@49name
whitespace@53
binary operator@54or
whitespace@56
squote string@57'World'
whitespace@64
tag_end@65%]
text@67!\n
tag_start@69[%
whitespace@71
end@72end
whitespace@75
tag_end@76%]
text@78\n\n
eof@80

Parse Tree

fill keyword@3fill
Template
filename element@8message
text@18\n\n
block keyword@23block
Name
filename element@29message
Block
text@39\nHello
binary expr@54name or 'World'
variable element@49name
or
squote string element@57'World'
text@67!\n
text@78\n\n

Variables Used

name
Uses
@ line 4Hello [% name or 'World' %]!

Generated Output

Hello World!