TT3: /home/abw/web/london/tt3/slides/examples/with_braces.tt3
Source
Tokens
Tree
Variables
Output
Template Source
[%
with
x
=
100
,
z
=
300
{
"x is $x\n"
"y is "
~
y
~
"\n"
"z is "
z
"\n"
}
%]
--EOF--
Source Tokens
tag_start
@0
[%
whitespace
@2
command with
@4
with
whitespace
@8
variable
@9
x
operator assign
@10
=
number
@11
100
separator
@14
,
whitespace
@15
variable
@16
z
operator assign
@17
=
number
@18
300
whitespace
@21
construct hash
@22
{
whitespace
@23
\n
dquote
@32
"x is $x\n"
whitespace
@43
\n
dquote
@52
"y is "
whitespace
@59
text combine
@60
~
whitespace
@61
variable
@62
y
whitespace
@63
text combine
@64
~
whitespace
@65
dquote
@66
"\n"
whitespace
@70
\n
dquote
@79
"z is "
whitespace
@86
variable
@87
z
whitespace
@88
dquote
@89
"\n"
whitespace
@93
\n
terminator
@98
}
whitespace
@99
\n
tag_end
@100
%]
text
@102
\n
eof
@103
Parse Tree
with keyword
@4
with
Data
binary expr
@10
x = 100
variable element
@9
x
=
number element
@11
100
binary expr
@17
z = 300
variable element
@16
z
=
number element
@18
300
Block
dquote string element
@32
"x is $x\n"
text
@33
x is
variable element
@39
x
text
@40
\n
binary expr
@64
"y is " ~ y ~ "\n"
binary expr
@60
"y is " ~ y
string element
@52
"y is "
text
@52
y is
~
variable element
@62
y
~
string element
@66
"\n"
text
@66
\n
string element
@79
"z is "
text
@79
z is
variable element
@87
z
string element
@89
"\n"
text
@89
\n
text
@102
\n
Variables Used
x
Uses
@ line 2
"x is $
x
\n"
@ line 1
[% with
x
=100, z=300 {
y
Uses
@ line 3
"y is " ~
y
~ "\n"
z
Uses
@ line 4
"z is "
z
"\n"
@ line 1
[% with x=100,
z
=300 {
Generated Output
TT3 undefined data error at line 3 of /home/abw/web/london/tt3/slides/examples/with_braces.tt3:
Error:
Undefined value returned by expression: y
Source:
"y is " ~ y ~ "\n"
^ here