[EMAIL PROTECTED] (Dan Sugalski) writes:At 5:47 PM +0000 3/19/03, Simon Cozens wrote: >[EMAIL PROTECTED] (Dan Sugalski) writes: >> you aren't allowed to selectively redefine >> rules in the middle of a regex that uses those rules. > >This is precisely what a macro does.
Not once execution starts, no.
Compilation's just execution of a regex, albeit the Perl6::Grammar::program regex, and that regex will need to be modified while it's in operation in order to pick up macro "is parsed" definitions and apply them to the rest of what it's parsing.
Ah, damn, I wasn't thinking far enough out. I'm not sure it'll work quite like that, with a single call to the regex engine that spits out everything in one go. More likely it'll be a set of iterative calls to the engine that terminate at natural sequence points, potentially with recursive calls into the parsing regex.
-- Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk