Python & regular expressions Show more
Oh, geez. "The compiled versions of the most recent patterns passed to re.compile() and the module-level matching functions are cached, so programs that use only a few regular expressions at a time needn’t worry about compiling regular expressions."
So then the question is, how many are cached? Probably enough to handle all the terminals likely to be in a grammar.
re: Python & regular expressions Show more
@drwho Oh, yeah, a ton of them. PyPEG comes the closest to what I want, but it doesn't support left recursion. I have come up with a technique for handling left recursion with a PEG that's a lot more straightforward than the one I've found in the literature. I've also implemented it multiple times now, so mostly I've just been trying to figure out the best way to express grammars.