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

Template Source

[% with x=100, z=300; "x is $x\n"; "y is " ~ y ~ "\n"; "z is " z "\n"; end; %] --EOF--

Source Tokens

tag_start@0[%
whitespace@2
command with@4with
whitespace@8
variable@9x
operator assign@10=
number@11100
separator@14,
whitespace@15
variable@16z
operator assign@17=
number@18300
delimiter@21;
whitespace@22\n
dquote@31"x is $x\n"
delimiter@42;
whitespace@43\n
dquote@52"y is "
whitespace@59
text combine@60~
whitespace@61
variable@62y
whitespace@63
text combine@64~
whitespace@65
dquote@66"\n"
delimiter@70;
whitespace@71\n
dquote@80"z is "
whitespace@87
variable@88z
whitespace@89
dquote@90"\n"
delimiter@94;
whitespace@95\n
end@100end
delimiter@103;
whitespace@104\n
tag_end@105%]
text@107\n
eof@108

Parse Tree

with keyword@4with
Data
binary expr@10x = 100
variable element@9x
=
number element@11100
binary expr@17z = 300
variable element@16z
=
number element@18300
Block
dquote string element@31"x is $x\n"
text@32x is
variable element@38x
text@39\n
binary expr@64"y is " ~ y ~ "\n"
binary expr@60"y is " ~ y
string element@52"y is "
text@52y is
~
variable element@62y
~
string element@66"\n"
text@66\n
string element@80"z is "
text@80z is
variable element@88z
string element@90"\n"
text@90\n
text@107\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_inline.tt3:
Error: Undefined value returned by expression: y
Source: "y is " ~ y ~ "\n";
^ here