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 -- http://mail.python.org/mailman/listinfo/python-list