Rod Adams writes: > Since the line between rules and subs is already blurring significantly, > I want to blur it a little more. I want to write rules which can take > parameters.
No no no! That's too powerful. Wow, skimming through both S5 and A5 and I see no mention of such a thing. I know we've had it planned for quite a while. > Consider that I am parsing HTML (a very frequent occurrence), and wish > to make a Rule that matches a balanced tag from open to close. I want > to use the same code many different times, but for different tags. So I > really want to say something like: > > rule baltag (Rule|Str $<tag>) { > \< $<tag> \s* $<options> := (.*?) \> > $<body> := (.*?) > \</ $<tag> \> > } Replace $<tag> with $tag and you're all set. We may allow putting $<tag> directly in the parameter list for inclusion in the parse tree. Luke