"Kent Johnson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul McGuire wrote: > > The alternatives I've come up with for the user to enable this packrat parse > > mode are: > > > > 1. Add a staticmethod enablePackrat() to the pyparsing ParserElement class, > > to modify the ParserElement defintion of the internal (non-packrat) parse() > > method. This method essentially runs code looking like: > > > > ParserElement.parse,ParserElement.originalParse = \ > > ParserElement.packratParse,ParserElement.parse > > Could you just define a module pyparsingpackrat like this: > from pyparsing import * > ParserElement.parse,ParserElement.originalParse = \ > ParserElement.packratParse,ParserElement.parse > > Then users would just import pyparsingpackrat instead of pyparsing. > > Kent (damned touchy touchpad!)
... anyway... I *really* like keeping pyparsing's footprint down to just one Python module. It would be nice if I could pass an argument along with the import statement: import pyparsing(packrat=True) or some such. -- Paul -- http://mail.python.org/mailman/listinfo/python-list