[%subfoo(a,b,%c,@d){
# a and b are formal named params
# c is a hash of any other named params
# d is a list of any other positional arguments
"a is $a, b is $b, c has $c.keys.join, d has $d.join"}foo(10,20,x=30,y=40,50,60)foo(50,x=30,y=40,a=10,b=20,60)%]--EOF--
Source Tokens
tag_start@0[%
whitespace@2
command sub@4sub
whitespace@7
filename@8foo
construct parens@11(
variable@12a
separator@13,
whitespace@14
variable@15b
separator@16,
whitespace@17
sigil hash@18%
variable@19c
separator@20,
whitespace@21
sigil list@22@
variable@23d
terminator@24)
whitespace@25
construct hash@26{
whitespace@27\n # a and b are formal named params\n # c is a hash of any other named params\n # d is a list of any other positional arguments\n
dquote@178"a is $a, b is $b, c has $c.keys.join, d has $d.join"
whitespace@231\n
terminator@236}
whitespace@237\n\n
variable@243foo
variable apply@246(
number@24710
separator@249,
whitespace@250
number@25120
separator@253,
whitespace@254
variable@255x
operator assign@256=
number@25730
separator@259,
whitespace@260
variable@261y
operator assign@262=
number@26340
separator@265,
whitespace@266
number@26750
separator@269,
whitespace@270
number@27160
terminator@273)
whitespace@274\n\n
variable@280foo
variable apply@283(
number@28450
separator@286,
whitespace@287
variable@288x
operator assign@289=
number@29030
separator@292,
whitespace@293
variable@294y
operator assign@295=
number@29640
separator@298,
whitespace@299
variable@300a
operator assign@301=
number@30210
separator@304,
whitespace@305
variable@306b
operator assign@307=
number@30820
separator@310,
whitespace@311
number@31260
terminator@314)
whitespace@315\n
tag_end@316%]
text@318\n
eof@319
Parse Tree
sub keyword@4foo()
Name
filename element@8foo
Block
dquote string element@178"a is $a, b is $b, c has $c.keys.join, d has $d.join"
text@179a is
variable element@185a
text@186, b is
variable element@194b
text@195, c has
binary expr@210c.keys.join
binary expr@205c.keys
variable element@204c
.
word element@206keys
.
word element@211join
text@215, d has
binary expr@225d.join
variable element@224d
.
word element@226join
sub keyword@246foo(10; 20; x = 30; y = 40; 50; 60)
Call
variable element@243foo
Args
number element@24710
number element@25120
binary expr@256x = 30
variable element@255x
=
number element@25730
binary expr@262y = 40
variable element@261y
=
number element@26340
number element@26750
number element@27160
sub keyword@283foo(50; x = 30; y = 40; a = 10; b = 20; 60)
Call
variable element@280foo
Args
number element@28450
binary expr@289x = 30
variable element@288x
=
number element@29030
binary expr@295y = 40
variable element@294y
=
number element@29640
binary expr@301a = 10
variable element@300a
=
number element@30210
binary expr@307b = 20
variable element@306b
=
number element@30820
number element@31260
text@318\n
Variables Used
a
Uses
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
@ line 1[% sub foo(a, b, %c, @d) {
@ line 10 foo(50, x=30, y=40, a=10, b=20, 60)
b
Uses
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
@ line 1[% sub foo(a, b, %c, @d) {
@ line 10 foo(50, x=30, y=40, a=10, b=20, 60)
c
Uses
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
@ line 1[% sub foo(a, b, %c, @d) {
Vars
keys
Uses
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
Vars
join
Uses
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
d
Uses
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
@ line 1[% sub foo(a, b, %c, @d) {
Vars
join
Uses
@ line 5 "a is $a, b is $b, c has $c.keys.join, d has $d.join"
foo
Uses
@ line 8foo(10, 20, x=30, y=40, 50, 60)
@ line 10foo(50, x=30, y=40, a=10, b=20, 60)
x
Uses
@ line 8 foo(10, 20, x=30, y=40, 50, 60)
@ line 10 foo(50, x=30, y=40, a=10, b=20, 60)
y
Uses
@ line 8 foo(10, 20, x=30, y=40, 50, 60)
@ line 10 foo(50, x=30, y=40, a=10, b=20, 60)
Generated Output
a is 10, b is 20, c has y x, d has 50 60a is 10, b is 20, c has y x, d has 50 60