TT3: /home/abw/web/london/tt3/slides/examples/list_context.tt3
Source
Tokens
Tree
Variables
Output
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
@4
foo
variable apply
@7
(
terminator
@8
)
whitespace
@9
# called in scalar context\n
variable
@51
bar
operator dot
@54
.
word
@55
baz
construct parens
@58
(
terminator
@59
)
whitespace
@60
\n \n
sigil list
@77
@
variable
@78
foo
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
@7
foo()
Call
variable element
@4
foo
Args
binary expr
@54
bar.baz
variable element
@51
bar
.
word element
@55
baz
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