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

Template Source

[% foo() # called in scalar context bar.baz() @foo() # called in list context # bar.@baz() # NFG ATM %] --EOF--

Source Tokens

tag_start@0[%
whitespace@2
variable@4foo
variable apply@7(
terminator@8)
whitespace@9 # called in scalar context\n
variable@51bar
operator dot@54.
word@55baz
construct parens@58(
terminator@59)
whitespace@60 \n \n
sigil list@77@
variable@78foo
variable apply@81(
terminator@82)
whitespace@83 # called in list context\n# bar.@baz() # NFG ATM\n
tag_end@148%]
text@150\n
eof@151

Parse Tree

sub keyword@7foo()
Call
variable element@4foo
Args
binary expr@54bar.baz
variable element@51bar
.
word element@55baz
Template::TT3::Element::Sigil::List=ARRAY(0xa163ec)
text@150\n

Variables Used

bar
Uses
@ line 2 bar.baz()
Vars
baz
Uses
@ line 2 bar.baz()
foo
Uses
@ line 1[% foo() # called in scalar context
@ line 4 @foo() # called in list context

Generated Output

TT3 undefined data error at line 1 of /home/abw/web/london/tt3/slides/examples/list_context.tt3:
Error: Undefined value returned by expression: foo()
Source: [% foo() # called in scalar context
^ here