Dan Sugalski: # While I'm not going to dive too deep into regexes (I like what little # sanity I have left, thanks :), here are a few opcodes I've
Oh, c'mon, they're not that bad. It's basically just "if this works, do the next thing, otherwise go back and do some stuff over". "Do some stuff over" is just popping a position off a stack and branching back to the op that should be done over. Even lookaheads aren't really that bad--you just push the current position onto the RE stack and make sure you return to it when the lookahead is finished. (Unless I'm missing something, which is certainly possible...) # been thinking of # for making REs faster: # # =begin proposed_opcodes # # =item makebitlist sx, sy # # Makes the string in X a bitmap, with one bit set in it for # each character # in Y. (So if Y was "AB" bits 64 and 65 would be set, assuming # I remember my # ASCII) # # =item ifin sx, iy, DEST # # If bit Y of bitlist X is set branch to DEST # # =item ifnotin sx, iy, DEST # # If bit Y of bitlist X is not set branch to DEST # # =end proposed_opcodes # # I think we already have ops to put the integer value of a # single character # (taken from an offset from the beginning of a string) into an integer # register, but if we don't we should. Have you looked at the regexp patch I posted last night? It's pretty much functional, including reOneof. Still, these could be useful internal functions... *ponder* --Brent Dax [EMAIL PROTECTED] Configure pumpking for Perl 6 When I take action, I'm not going to fire a $2 million missile at a $10 empty tent and hit a camel in the butt. --Dubya