TT3: /home/abw/web/london/tt3/slides/examples/unpack_lists.tt3
Source
Tokens
Tree
Variables
Output
Template Source
[%
a
=
[
1
,
2
,
3
]
b
=
[
4
,
5
,
6
]
c
=
[
@
a
,
@
b
]
%]
--EOF--
Source Tokens
tag_start
@0
[%
whitespace
@2
variable
@4
a
whitespace
@5
operator assign
@6
=
whitespace
@7
construct list
@8
[
number
@9
1
separator
@10
,
whitespace
@11
number
@12
2
separator
@13
,
whitespace
@14
number
@15
3
terminator
@16
]
whitespace
@17
\n
variable
@22
b
whitespace
@23
operator assign
@24
=
whitespace
@25
construct list
@26
[
number
@27
4
separator
@28
,
whitespace
@29
number
@30
5
separator
@31
,
whitespace
@32
number
@33
6
terminator
@34
]
whitespace
@35
\n
variable
@40
c
whitespace
@41
operator assign
@42
=
whitespace
@43
construct list
@44
[
sigil list
@45
@
variable
@46
a
separator
@47
,
whitespace
@48
sigil list
@49
@
variable
@50
b
terminator
@51
]
whitespace
@52
\n
tag_end
@53
%]
text
@55
\n
eof
@56
Parse Tree
binary expr
@6
a = [ 1; 2; 3 ]
variable element
@4
a
=
list expr
@8
[ 1; 2; 3 ]
[
number element
@9
1
number element
@12
2
number element
@15
3
]
binary expr
@24
b = [ 4; 5; 6 ]
variable element
@22
b
=
list expr
@26
[ 4; 5; 6 ]
[
number element
@27
4
number element
@30
5
number element
@33
6
]
binary expr
@42
c = [ @a; @b ]
variable element
@40
c
=
list expr
@44
[ @a; @b ]
[
Template::TT3::Element::Sigil::List=ARRAY(0xa16620)
Template::TT3::Element::Sigil::List=ARRAY(0x9ef0ac)
]
text
@55
\n
Variables Used
a
Uses
@ line 1
[%
a
= [1, 2, 3]
@ line 3
c = [@
a
, @b]
b
Uses
@ line 2
b
= [4, 5, 6]
@ line 3
c = [@a, @
b
]
c
Uses
@ line 3
c
= [@a, @b]
Generated Output