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

Template Source

[? HTML_CMDS ul li a ?] [% ul { for ['Example One', 'Example Two' 'Example Three'] { li item } } %] --EOF--

Source Tokens

tag_start@0[?
whitespace@2
control htmlcmds@3HTML_CMDS
whitespace@12
variable@13ul
whitespace@15
variable@16li
whitespace@18
variable@19a
whitespace@20
tag_end@21?]
text@23\n\n
tag_start@25[%
whitespace@27
html ul@28ul
whitespace@30
construct hash@31{
whitespace@32\n
command for@38for
whitespace@41
construct list@42[
squote string@43'Example One'
separator@56,
whitespace@57
squote string@58'Example Two'
whitespace@71
squote string@72'Example Three'
terminator@87]
whitespace@88
construct hash@89{
whitespace@90\n
html li@98li
whitespace@100
variable@101item
whitespace@105 \n
terminator@112}
whitespace@113\n
terminator@117}
whitespace@118\n
tag_end@119%]
text@121\n
eof@122

Parse Tree

text@23\n\n
html keyword element@28ul
for keyword@38for
List
list expr@42[ 'Example One'; 'Example Two'; 'Example Three' ]
[
squote string element@43'Example One'
squote string element@58'Example Two'
squote string element@72'Example Three'
]
Then
html keyword element@98li
variable element@101item
text@121\n

Variables Used

item
Uses
@ line 5 li item

Generated Output

<ul><li>Example One</li><li>Example Two</li><li>Example Three</li></ul>