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

Template Source

[% a = b # regular assignment a => b # fat comma quotes LHS: ('a', b) foo( a = 10, b = 20 ) # foo({ a => 10, b => 20 }) foo( a => 10, b => 20 ) # foo( a => 10, b => 20 ) # foo('a', 10, 'b', 20) foo({ a => 10, b => 20 }) # foo({ a => 10, b => 20 }) %]--EOF--

Source Tokens

tag_start@0[%
whitespace@2\n
variable@7a
whitespace@8
operator assign@9=
whitespace@10
variable@11b
whitespace@12 # regular assignment\n
variable@58a
whitespace@59
operator pair@60=>
whitespace@62
variable@63b
whitespace@64 # fat comma quotes LHS: ('a', b)\n\n
variable@122foo
variable apply@125(
whitespace@126
variable@127a
whitespace@128
operator assign@129=
whitespace@130
number@13110
separator@133,
whitespace@134
variable@135b
whitespace@136
operator assign@137=
whitespace@138
number@13920
whitespace@141
terminator@142)
whitespace@143 # foo({ a => 10, b => 20 })\n\n
variable@181foo
variable apply@184(
whitespace@185
variable@186a
whitespace@187
operator pair@188=>
whitespace@190
number@19110
separator@193,
whitespace@194
variable@195b
whitespace@196
operator pair@197=>
whitespace@199
number@20020
whitespace@202
terminator@203)
whitespace@204 # foo( a => 10, b => 20 )\n # foo('a', 10, 'b', 20)\n\n
variable@292foo
variable apply@295(
construct hash@296{
whitespace@297
variable@298a
whitespace@299
operator pair@300=>
whitespace@302
number@30310
separator@305,
whitespace@306
variable@307b
whitespace@308
operator pair@309=>
whitespace@311
number@31220
whitespace@314
terminator@315}
terminator@316)
whitespace@317 # foo({ a => 10, b => 20 })\n\n
tag_end@347%]
eof@349

Parse Tree

binary expr@9a = b
variable element@7a
=
variable element@11b
binary pair expr@60a => b
word element@58a
=>
variable element@63b
sub keyword@125foo(a = 10; b = 20)
Call
variable element@122foo
Args
binary expr@129a = 10
variable element@127a
=
number element@13110
binary expr@137b = 20
variable element@135b
=
number element@13920
sub keyword@184foo(a => 10; b => 20)
Call
variable element@181foo
Args
binary pair expr@188a => 10
word element@186a
=>
number element@19110
binary pair expr@197b => 20
word element@195b
=>
number element@20020
sub keyword@295foo({ a => 10; b => 20 })
Call
variable element@292foo
Args
hash expr@296{ a => 10; b => 20 }
{
binary pair expr@300a => 10
word element@298a
=>
number element@30310
binary pair expr@309b => 20
word element@307b
=>
number element@31220
}

Variables Used

a
Uses
@ line 2 a = b # regular assignment
@ line 3 a => b # fat comma quotes LHS: ('a', b)
@ line 5 foo( a = 10, b = 20 ) # foo({ a => 10, b => 20 })
@ line 7 foo( a => 10, b => 20 ) # foo( a => 10, b => 20 )
@ line 10 foo({ a => 10, b => 20 }) # foo({ a => 10, b => 20 })
b
Uses
@ line 2 a = b # regular assignment
@ line 3 a => b # fat comma quotes LHS: ('a', b)
@ line 5 foo( a = 10, b = 20 ) # foo({ a => 10, b => 20 })
@ line 7 foo( a => 10, b => 20 ) # foo( a => 10, b => 20 )
@ line 10 foo({ a => 10, b => 20 }) # foo({ a => 10, b => 20 })
foo
Uses
@ line 5 foo( a = 10, b = 20 ) # foo({ a => 10, b => 20 })
@ line 7 foo( a => 10, b => 20 ) # foo( a => 10, b => 20 )
@ line 10 foo({ a => 10, b => 20 }) # foo({ a => 10, b => 20 })

Generated Output

TT3 undefined data error at line 2 of /home/abw/web/london/tt3/slides/examples/assignment_operators.tt3:
Error: Undefined value returned by expression: b
Source: a = b # regular assignment
^ here