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

Template Source

[% a = [1, 2, 3] b = [4, 5, 6] c = [@a, @b] %] --EOF--

Source Tokens

tag_start@0[%
whitespace@2
variable@4a
whitespace@5
operator assign@6=
whitespace@7
construct list@8[
number@91
separator@10,
whitespace@11
number@122
separator@13,
whitespace@14
number@153
terminator@16]
whitespace@17\n
variable@22b
whitespace@23
operator assign@24=
whitespace@25
construct list@26[
number@274
separator@28,
whitespace@29
number@305
separator@31,
whitespace@32
number@336
terminator@34]
whitespace@35\n
variable@40c
whitespace@41
operator assign@42=
whitespace@43
construct list@44[
sigil list@45@
variable@46a
separator@47,
whitespace@48
sigil list@49@
variable@50b
terminator@51]
whitespace@52\n
tag_end@53%]
text@55\n
eof@56

Parse Tree

binary expr@6a = [ 1; 2; 3 ]
variable element@4a
=
list expr@8[ 1; 2; 3 ]
[
number element@91
number element@122
number element@153
]
binary expr@24b = [ 4; 5; 6 ]
variable element@22b
=
list expr@26[ 4; 5; 6 ]
[
number element@274
number element@305
number element@336
]
binary expr@42c = [ @a; @b ]
variable element@40c
=
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