[?HTML_CMDSdivullia?][%menu=[{text=>'One',link=>'one.html'},{text=>'Two',link=>'two.html'},{text=>'Three',link=>'three.html'},]%][%div[id="header"] # goodness me, this
ul[class="menu"] # is a bit tedious!
formenulia[href=item.link]item.text%]--EOF--
Source Tokens
tag_start@0[?
whitespace@2
control htmlcmds@3HTML_CMDS
whitespace@12
variable@13div
whitespace@16
variable@17ul
whitespace@19
variable@20li
whitespace@22
variable@23a
whitespace@24
tag_end@25?]
text@27\n\n
tag_start@29[%
whitespace@31
variable@32menu
whitespace@36
operator assign@37=
whitespace@38
construct list@39[
whitespace@40\n
construct hash@46{
whitespace@47
variable@48text
whitespace@52
operator pair@53=>
whitespace@55
squote string@56'One'
separator@61,
whitespace@62
variable@65link
whitespace@69
operator pair@70=>
whitespace@72
squote string@73'one.html'
whitespace@83
terminator@86}
separator@87,
whitespace@88\n
construct hash@94{
whitespace@95
variable@96text
whitespace@100
operator pair@101=>
whitespace@103
squote string@104'Two'
separator@109,
whitespace@110
variable@113link
whitespace@117
operator pair@118=>
whitespace@120
squote string@121'two.html'
whitespace@131
terminator@134}
separator@135,
whitespace@136\n
construct hash@142{
whitespace@143
variable@144text
whitespace@148
operator pair@149=>
whitespace@151
squote string@152'Three'
separator@159,
whitespace@160
variable@161link
whitespace@165
operator pair@166=>
whitespace@168
squote string@169'three.html'
whitespace@181
terminator@182}
separator@183,
whitespace@184\n
terminator@188]
whitespace@189\n
tag_end@190%]
text@192\n\n
tag_start@194[%
whitespace@196
html div@197div
construct list@200[
variable@201id
operator assign@203=
dquote@204"header"
terminator@212]
whitespace@213 # goodness me, this\n
html ul@259ul
construct list@261[
variable@262class
operator assign@267=
dquote@268"menu"
terminator@274]
whitespace@275 # is a bit tedious!\n
command for@321for
whitespace@324
variable@325menu
whitespace@329 \n
html li@348li
whitespace@350
html a@351a
construct list@352[
variable@353href
operator assign@357=
variable@358item
operator dot@362.
word@363link
terminator@367]
whitespace@368
variable@369item
operator dot@373.
word@374text
whitespace@378\n
tag_end@379%]
text@381\n
eof@382
Parse Tree
text@27\n\n
binary expr@37menu = [ { text => 'One'; link => 'one.html' }; { text => 'Two'; link => 'two.html' }; { text => 'Three'; link => 'three.html' } ]
variable element@32menu
=
list expr@39[ { text => 'One'; link => 'one.html' }; { text => 'Two'; link => 'two.html' }; { text => 'Three'; link => 'three.html' } ]
[
hash expr@46{ text => 'One'; link => 'one.html' }
{
binary pair expr@53text => 'One'
word element@48text
=>
squote string element@56'One'
binary pair expr@70link => 'one.html'
word element@65link
=>
squote string element@73'one.html'
}
hash expr@94{ text => 'Two'; link => 'two.html' }
{
binary pair expr@101text => 'Two'
word element@96text
=>
squote string element@104'Two'
binary pair expr@118link => 'two.html'
word element@113link
=>
squote string element@121'two.html'
}
hash expr@142{ text => 'Three'; link => 'three.html' }
{
binary pair expr@149text => 'Three'
word element@144text
=>
squote string element@152'Three'
binary pair expr@166link => 'three.html'
word element@161link
=>
squote string element@169'three.html'
}
]
text@192\n\n
html keyword element@197div
html keyword element@259ul
for keyword@321for
List
variable element@325menu
Then
html keyword element@348li
html keyword element@351a
binary expr@373item.text
variable element@369item
.
word element@374text
text@381\n
Variables Used
class
Uses
@ line 11 ul[class="menu"] # is a bit tedious!
href
Uses
@ line 13 li a[href=item.link] item.text
id
Uses
@ line 10[% div[id="header"] # goodness me, this
item
Uses
@ line 13 li a[href=item.link] item.text
@ line 13 li a[href=item.link] item.text
Vars
link
Uses
@ line 13 li a[href=item.link] item.text
text
Uses
@ line 13 li a[href=item.link] item.text
link
Uses
@ line 4 { text => 'One', link => 'one.html' },
@ line 5 { text => 'Two', link => 'two.html' },
@ line 6 { text => 'Three', link => 'three.html' },
menu
Uses
@ line 3[% menu = [
@ line 12 for menu
text
Uses
@ line 4 { text => 'One', link => 'one.html' },
@ line 5 { text => 'Two', link => 'two.html' },
@ line 6 { text => 'Three', link => 'three.html' },