pyparsing v1.5.1 Release Notes

Release Date: 2008-10-01 // over 15 years ago
    • โž• Added new helper method originalTextFor, to replace the use of the current keepOriginalText parse action. Now instead of using the parse action, as in:

      fullName = Word(alphas) + Word(alphas) fullName.setParseAction(keepOriginalText)

    (in this example, we used keepOriginalText to restore any white space that may have been skipped between the first and last names) You can now write:

      fullName = originalTextFor(Word(alphas) + Word(alphas))
    

    The implementation of originalTextFor is simpler and faster than keepOriginalText, and does not depend on using the inspect or imp modules.

    • โž• Added optional parseAll argument to parseFile, to be consistent with parseAll argument to parseString. Posted by pboucher on the pyparsing wiki, thanks!

    • โž• Added failOn argument to SkipTo, so that grammars can define literal strings or pyparsing expressions which, if found in the skipped text, will cause SkipTo to fail. Useful to prevent SkipTo from reading past terminating expression. Instigated by question posed by Aki Niimura on the pyparsing wiki.

    • ๐Ÿ›  Fixed bug in nestedExpr if multi-character expressions are given for nesting delimiters. Patch provided by new pyparsing user, Hans-Martin Gaudecker - thanks, H-M!

    • โœ‚ Removed dependency on xml.sax.saxutils.escape, and included internal implementation instead - proposed by Mike Droettboom on the pyparsing mailing list, thanks Mike! Also fixed erroneous mapping in replaceHTMLEntity of " to ', now correctly maps to ". (Also added support for mapping ' to '.)

    • ๐Ÿ›  Fixed typo in ParseResults.insert, found by Alejandro Dubrovsky, good catch!

    • Added dir() methods to ParseBaseException and ParseResults, to support new dir() behavior in Py2.6 and Py3.0. If dir() is called on a ParseResults object, the returned list will include the base set of attribute names, plus any results names that are defined.

    • ๐Ÿ›  Fixed bug in ParseResults.asXML(), in which the first named item within a ParseResults gets reported with an tag instead of with the correct results name.

    • ๐Ÿ›  Fixed bug in '-' error stop, when '-' operator is used inside a Combine expression.

    • โช Reverted generator expression to use list comprehension, for better compatibility with old versions of Python. Reported by jester/artixdesign on the SourceForge pyparsing discussion list.

    • ๐Ÿ›  Fixed bug in parseString(parseAll=True), when the input string ends with a comment or whitespace.

    • ๐Ÿ›  Fixed bug in LineStart and LineEnd that did not recognize any special whitespace chars defined using ParserElement.setDefault- WhitespaceChars, found while debugging an issue for Marek Kubica, thanks for the new test case, Marek!

    • Made Forward class more tolerant of subclassing.