Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Problem with Parse::RecDescent and subrule argumentsby jryan (Vicar) |
on Aug 26, 2004 at 00:30 UTC ( [id://385873]=note: print w/replies, xml ) | Need Help?? |
This one had me stumpted. subrule(s /,/) is just a macro for <leftop: subrule /,/ subrule>, and so subrule(s? /,/) is just a macro for <leftop: subrule /,/ subrule>(?). However, internally, I think that leftop goes through another level, and so @arg must get overwritten. (that's just a guess as to what is happening, so don't take it as fact.) Anyways, whatever P::RD is doing internally, I would classify it as a bug. However, just telling you that its a bug isn't really helping you, so here is a workaround:
This is much more inefficent then using <leftop:> would be, but at least it works (at least as far as I've tested it.) I also collapsed your variabletype rule into a single regex, which will be much more efficient.
In Section
Seekers of Perl Wisdom
|
|