TT3: /home/abw/web/london/tt3/slides/examples/order_items_outline.tt3
Source
Tokens
Tree
Variables
Output
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
@4
if
whitespace
@6
variable
@7
order
operator dot
@12
.
word
@13
items
operator dot
@18
.
word
@19
size
tag_end
@23
\n
text
@24
<ul>\n
tag_start
@29
%%
whitespace
@31
command for
@37
for
whitespace
@40
variable
@41
order
operator dot
@46
.
word
@47
items
tag_end
@52
\n
text
@53
<li>
tag_start
@59
[%
whitespace
@61
variable
@62
item
operator dot
@66
.
word
@67
quantity
whitespace
@75
tag_end
@76
%]
text
@78
tag_start
@79
[%
whitespace
@81
variable
@82
item
operator dot
@86
.
word
@87
description
whitespace
@98
tag_end
@99
%]
text
@101
</li>\n
tag_start
@107
%%
whitespace
@109
end
@115
end
tag_end
@118
\n
text
@119
</ul>\n
tag_start
@125
%%
whitespace
@127
end
@129
end
tag_end
@132
\n
eof
@133
Parse Tree
if keyword
@4
if order.items.size { "<ul>\n"; for; "</ul>\n" }
Test
binary expr
@18
order.items.size
binary expr
@12
order.items
variable element
@7
order
.
word element
@13
items
.
word element
@19
size
True
text
@24
<ul>\n
for keyword
@37
for
List
binary expr
@46
order.items
variable element
@41
order
.
word element
@47
items
Then
text
@53
<li>
binary expr
@66
item.quantity
variable element
@62
item
.
word element
@67
quantity
text
@78
binary expr
@86
item.description
variable element
@82
item
.
word element
@87
description
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