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

Template Source

[% html_element(type, %attrs, @content) = "<$type$attrs.html_attrs>$content.join</$type>" html_element('a', href='home.html', 'Home') %] --EOF--

Source Tokens

tag_start@0[%
whitespace@2
variable@4html_element
variable apply@16(
variable@17type
separator@21,
whitespace@22
sigil hash@23%
variable@24attrs
separator@29,
whitespace@30
sigil list@31@
variable@32content
terminator@39)
whitespace@40
operator assign@41=
whitespace@42 \n
dquote@52"<$type$attrs.html_attrs>$content.join</$type>"
whitespace@99\n\n
variable@105html_element
variable apply@117(
squote string@118'a'
separator@121,
whitespace@122
variable@123href
operator assign@127=
squote string@128'home.html'
separator@139,
whitespace@140
squote string@141'Home'
terminator@147)
whitespace@148\n
tag_end@149%]
text@151\n
eof@152

Parse Tree

binary expr@41html_element = "<$type$attrs.html_attrs>$content.join</$type>"
variable element@4html_element
=
sub keyword@17"<$type$attrs.html_attrs>$content.join</$type>"
Name
sub keyword@16html_element(type; %attrs; @content)
Call
variable element@4html_element
Args
variable element@17type
Template::TT3::Element::Sigil::Hash=ARRAY(0xa02d54)
Template::TT3::Element::Sigil::List=ARRAY(0x9d32d4)
Block
dquote string element@52"<$type$attrs.html_attrs>$content.join</$type>"
text@53<
variable element@55type
binary expr@65attrs.html_attrs
variable element@60attrs
.
word element@66html_attrs
text@76>
binary expr@85content.join
variable element@78content
.
word element@86join
text@90</
variable element@93type
text@97>
sub keyword@117html_element('a'; href = 'home.html'; 'Home')
Call
variable element@105html_element
Args
squote string element@118'a'
binary expr@127href = 'home.html'
variable element@123href
=
squote string element@128'home.html'
squote string element@141'Home'
text@151\n

Variables Used

attrs
Uses
@ line 1[% html_element(type, %attrs, @content) =
@ line 2 "<$type$attrs.html_attrs>$content.join</$type>"
@ line 2 "<$type$attrs.html_attrs>$content.join</$type>"
Vars
html_attrs
Uses
@ line 2 "<$type$attrs.html_attrs>$content.join</$type>"
content
Uses
@ line 1[% html_element(type, %attrs, @content) =
@ line 2 "<$type$attrs.html_attrs>$content.join</$type>"
@ line 2 "<$type$attrs.html_attrs>$content.join</$type>"
Vars
join
Uses
@ line 2 "<$type$attrs.html_attrs>$content.join</$type>"
href
Uses
@ line 4 html_element('a', href='home.html', 'Home')
html_element
Uses
@ line 1[% html_element(type, %attrs, @content) =
@ line 1[% html_element(type, %attrs, @content) =
@ line 4 html_element('a', href='home.html', 'Home')
type
Uses
@ line 1[% html_element(type, %attrs, @content) =
@ line 2 "<$type$attrs.html_attrs>$content.join</$type>"
@ line 2 "<$type$attrs.html_attrs>$content.join</$type>"

Generated Output

<a href="home.html">Home</a>