in reply to
Returning contents of subrules matches with Parse::RecDescent
Here is what the master, Damian Conway, sayeth:
Your problem is in this rule:
tuple : (number dot)(2)
is the same as:
tuple : anon_subrule(2)
anon_subrule : number dot
Liek all subrules, this anonymous subrule returns only its last item
(namely, the dot). If you want just the number back, write this:
tuple : (number dot {$item[1]})(2)
If you want both number and dot back (in a nested array), write this:
tuple : (number dot {\@item})(2)
Hope this helps,
Damian