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

Template Source

[% sub bold(text) "<b>$text</b>" bold('Hello World') %] --EOF--

Source Tokens

tag_start@0[%
whitespace@2
command sub@4sub
whitespace@7
filename@8bold
construct parens@12(
variable@13text
terminator@17)
whitespace@18 \n
dquote@26"<b>$text</b>"
whitespace@40\n\n
variable@46bold
variable apply@50(
squote string@51'Hello World'
terminator@64)
whitespace@65\n
tag_end@66%]
text@68\n
eof@69

Parse Tree

sub keyword@4bold()
Name
filename element@8bold
Block
dquote string element@26"<b>$text</b>"
text@27<b>
variable element@31text
text@35</b>
sub keyword@50bold('Hello World')
Call
variable element@46bold
Args
squote string element@51'Hello World'
text@68\n

Variables Used

bold
Uses
@ line 4 bold('Hello World')
text
Uses
@ line 2 "<b>$text</b>"
@ line 1[% sub bold(text)

Generated Output

<b>Hello World</b>