TT3: /home/abw/web/london/tt3/slides/examples/side_effect_sanity.tt3
Source
Tokens
Tree
Variables
Output
Template Source
[%
if
add_header
with
title
=
'Hello World'
{
fill
site
/
header
;
for
item
in
menu
fill
menu
/
item
;
}
%]
--EOF--
Source Tokens
tag_start
@0
[%
whitespace
@2
command if
@4
if
whitespace
@6
variable
@9
add_header
whitespace
@19
\n
command with
@24
with
whitespace
@28
variable
@29
title
operator assign
@34
=
squote string
@35
'Hello World'
whitespace
@48
construct hash
@49
{
whitespace
@50
\n
command fill
@60
fill
whitespace
@64
filename
@65
site
filename
@69
/
filename
@70
header
delimiter
@76
;
whitespace
@77
\n\n
command for
@88
for
whitespace
@91
variable
@92
item
whitespace
@96
terminator
@97
in
whitespace
@99
variable
@100
menu
whitespace
@104
\n
command fill
@118
fill
whitespace
@122
filename
@123
menu
filename
@127
/
filename
@128
item
delimiter
@132
;
whitespace
@133
\n
terminator
@138
}
whitespace
@139
\n
tag_end
@140
%]
text
@142
\n\n
eof
@144
Parse Tree
if keyword
@4
if add_header { with }
Test
variable element
@9
add_header
True
with keyword
@24
with
Data
binary expr
@34
title = 'Hello World'
variable element
@29
title
=
squote string element
@35
'Hello World'
Block
fill keyword
@60
fill
Template
filename element
@65
site/header
for keyword
@88
for
Item
variable element
@92
item
List
variable element
@100
menu
Then
fill keyword
@118
fill
Template
filename element
@123
menu/item
text
@142
\n\n
Variables Used
add_header
Uses
@ line 1
[% if
add_header
item
Uses
@ line 5
for
item
in menu
menu
Uses
@ line 5
for item in
menu
title
Uses
@ line 2
with
title
='Hello World' {
Generated Output
TT3 undefined data error at line 1 of /home/abw/web/london/tt3/slides/examples/side_effect_sanity.tt3:
Error:
Undefined value returned by expression: add_header
Source:
[% if add_header
^ here