TT3: /home/abw/web/london/tt3/slides/examples/side_effect_multi.tt3
Source
Tokens
Tree
Variables
Output
Template Source
[%
if
add_header
fill
site
/
header
with
title
=
'Hello World'
%]
[%
fill
menu
/
item
with
link
=
item
.
link
title
=
item
.
text
.
ucfirst
for
item
in
site
.
menu
if
add_menu
%]
--EOF--
Source Tokens
tag_start
@0
[%
whitespace
@2
command if
@4
if
whitespace
@6
variable
@9
add_header
whitespace
@19
\n
command fill
@24
fill
whitespace
@28
filename
@29
site
filename
@33
/
filename
@34
header
whitespace
@40
\n
command with
@45
with
whitespace
@49
variable
@50
title
operator assign
@55
=
squote string
@56
'Hello World'
whitespace
@69
\n
tag_end
@70
%]
text
@72
\n\n
tag_start
@74
[%
whitespace
@76
command fill
@78
fill
whitespace
@82
filename
@83
menu
filename
@87
/
filename
@88
item
whitespace
@92
\n
command with
@97
with
whitespace
@101
variable
@102
link
whitespace
@106
operator assign
@108
=
whitespace
@109
variable
@110
item
operator dot
@114
.
word
@115
link
whitespace
@119
\n
variable
@129
title
whitespace
@134
operator assign
@135
=
whitespace
@136
variable
@137
item
operator dot
@141
.
word
@142
text
operator dot
@146
.
word
@147
ucfirst
whitespace
@154
\n
command for
@159
for
whitespace
@162
variable
@164
item
whitespace
@168
terminator
@169
in
whitespace
@171
variable
@172
site
operator dot
@176
.
word
@177
menu
whitespace
@181
\n
command if
@186
if
whitespace
@188
variable
@191
add_menu
whitespace
@199
\n
tag_end
@200
%]
text
@202
\n
eof
@203
Parse Tree
with keyword
@45
with
Data
binary expr
@55
title = 'Hello World'
variable element
@50
title
=
squote string element
@56
'Hello World'
Block
if keyword
@4
if add_header { fill }
Test
variable element
@9
add_header
True
fill keyword
@24
fill
Template
filename element
@29
site/header
text
@72
\n\n
if keyword
@186
if add_menu { for }
Test
variable element
@191
add_menu
True
for keyword
@159
for
Item
variable element
@164
item
List
binary expr
@176
site.menu
variable element
@172
site
.
word element
@177
menu
Then
with keyword
@97
with
Data
binary expr
@108
link = item.link
variable element
@102
link
=
binary expr
@114
item.link
variable element
@110
item
.
word element
@115
link
binary expr
@135
title = item.text.ucfirst
variable element
@129
title
=
binary expr
@146
item.text.ucfirst
binary expr
@141
item.text
variable element
@137
item
.
word element
@142
text
.
word element
@147
ucfirst
Block
fill keyword
@78
fill
Template
filename element
@83
menu/item
text
@202
\n
Variables Used
add_header
Uses
@ line 1
[% if
add_header
add_menu
Uses
@ line 10
if
add_menu
item
Uses
@ line 7
with link =
item
.link
@ line 8
title =
item
.text.ucfirst
@ line 9
for
item
in site.menu
Vars
link
Uses
@ line 7
with link =
item.link
text
Uses
@ line 8
title =
item.text
.ucfirst
Vars
ucfirst
Uses
@ line 8
title =
item.text.ucfirst
link
Uses
@ line 7
with
link
= item.link
site
Uses
@ line 9
for item in
site
.menu
Vars
menu
Uses
@ line 9
for item in
site.menu
title
Uses
@ line 3
with
title
='Hello World'
@ line 8
title
= item.text.ucfirst
Generated Output
TT3 undefined data error at line 1 of /home/abw/web/london/tt3/slides/examples/side_effect_multi.tt3:
Error:
Undefined value returned by expression: add_header
Source:
[% if add_header
^ here