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

Template Source

%% if order.items.size <ul> %% for order.items <li>[% item.quantity %] [% item.description %]</li> %% end </ul> %% end --EOF--

Source Tokens

tag_start@0%%
whitespace@2
command if@4if
whitespace@6
variable@7order
operator dot@12.
word@13items
operator dot@18.
word@19size
tag_end@23\n
text@24<ul>\n
tag_start@29%%
whitespace@31
command for@37for
whitespace@40
variable@41order
operator dot@46.
word@47items
tag_end@52\n
text@53 <li>
tag_start@59[%
whitespace@61
variable@62item
operator dot@66.
word@67quantity
whitespace@75
tag_end@76%]
text@78
tag_start@79[%
whitespace@81
variable@82item
operator dot@86.
word@87description
whitespace@98
tag_end@99%]
text@101</li>\n
tag_start@107%%
whitespace@109
end@115end
tag_end@118\n
text@119</ul>\n
tag_start@125%%
whitespace@127
end@129end
tag_end@132\n
eof@133

Parse Tree

if keyword@4if order.items.size { "<ul>\n"; for; "</ul>\n" }
Test
binary expr@18order.items.size
binary expr@12order.items
variable element@7order
.
word element@13items
.
word element@19size
True
text@24<ul>\n
for keyword@37for
List
binary expr@46order.items
variable element@41order
.
word element@47items
Then
text@53 <li>
binary expr@66item.quantity
variable element@62item
.
word element@67quantity
text@78
binary expr@86item.description
variable element@82item
.
word element@87description
text@101</li>\n
text@119</ul>\n

Variables Used

item
Uses
@ line 4 <li>[% item.quantity %] [% item.description %]</li>
@ line 4 <li>[% item.quantity %] [% item.description %]</li>
Vars
description
Uses
@ line 4 <li>[% item.quantity %] [% item.description %]</li>
quantity
Uses
@ line 4 <li>[% item.quantity %] [% item.description %]</li>
order
Uses
@ line 1%% if order.items.size
@ line 3%% for order.items
Vars
items
Uses
@ line 1%% if order.items.size
@ line 3%% for order.items
Vars
size
Uses
@ line 1%% if order.items.size

Generated Output

TT3 undefined data error at line 1 of /home/abw/web/london/tt3/slides/examples/order_items_outline.tt3:
Error: Undefined value in 'order.items': order
Source: %% if order.items.size
^ here