P
Paul McGuire
I'm happy to announce v1.4.6 of pyparsing has been released.
This latest version of pyparsing has a few minor bug-fixes and
enhancements, and another performance improvement for recursive
grammars (those that use the Forward class).
The salient features of this new release are:
Simplified the ParseException constructor, to better support the
standard exception idiom:
raise ParseFatalException, "unexpected text: 'Spanish Inquisition'"
Modified cyclic object references within ParseResults objects to use
weakrefs, to be gentler on the garbage collector.
Added method getTokensEndLoc(), to be called from within a parse
action,
for those parse actions that need both the starting *and* ending
location of the parsed tokens within the input text.
Various bug-fixes:
- tuple as named result now reports entire tuple, not just first
element
- SkipTo with include=True now returns the skipped-to tokens properly
- makeHTMLTags/makeXMLTags and anyOpenTag and anyCloseTag helpers now
recognize attributes and tags with namespaces
- countedArray now matches when defined within an Or expression
- keepOriginalText now preserves named results fields
- fixed Unicode bug in upcase and downcase methods
- corrected typo in OnceOnly reset() method
- enhanced documentation to describe behavior when parsing input
strings containing tabs
- cleaned up internal decorators to preserve function names,
docstrings, etc.
This release also includes some new examples:
- holaMundo.py - Spanish translation of HelloWorld
- sexpParser.py - S-exp parser
- jsonParser.py (update) - minor bug-fixes to previously released
example for parsing JSON (JavaScript Object Notation) object
serialization strings
- macroExpander.py - macro preprocessor to substitute defined macros
Download pyparsing 1.4.6 at http://sourceforge.net/projects/pyparsing/.
The pyparsing Wiki is at http://pyparsing.wikispaces.com
-- Paul
========================================
Pyparsing is a pure-Python class library for quickly developing
recursive-descent parsers. Parser grammars are assembled directly in
the calling Python code, using classes such as Literal, Word,
OneOrMore, Optional, etc., combined with operators '+', '|', and '^'
for And, MatchFirst, and Or. No separate code-generation or external
files are required. Pyparsing can be used in many cases in place of
regular expressions, with shorter learning curve and greater
readability and maintainability. Pyparsing comes with a number of
parsing examples, including:
- "Hello, World!" (English, Korean, Greek, and Spanish(new))
- chemical formulas
- configuration file parser
- web page URL extractor
- 5-function arithmetic expression parser
- subset of CORBA IDL
- chess portable game notation
- simple SQL parser
- Mozilla calendar file parser
- EBNF parser/compiler
- Python value string parser (lists, dicts, tuples, with nesting)
(safe alternative to eval)
- HTML tag stripper
- S-expression parser (new)
- macro substitution preprocessor (new)
This latest version of pyparsing has a few minor bug-fixes and
enhancements, and another performance improvement for recursive
grammars (those that use the Forward class).
The salient features of this new release are:
Simplified the ParseException constructor, to better support the
standard exception idiom:
raise ParseFatalException, "unexpected text: 'Spanish Inquisition'"
Modified cyclic object references within ParseResults objects to use
weakrefs, to be gentler on the garbage collector.
Added method getTokensEndLoc(), to be called from within a parse
action,
for those parse actions that need both the starting *and* ending
location of the parsed tokens within the input text.
Various bug-fixes:
- tuple as named result now reports entire tuple, not just first
element
- SkipTo with include=True now returns the skipped-to tokens properly
- makeHTMLTags/makeXMLTags and anyOpenTag and anyCloseTag helpers now
recognize attributes and tags with namespaces
- countedArray now matches when defined within an Or expression
- keepOriginalText now preserves named results fields
- fixed Unicode bug in upcase and downcase methods
- corrected typo in OnceOnly reset() method
- enhanced documentation to describe behavior when parsing input
strings containing tabs
- cleaned up internal decorators to preserve function names,
docstrings, etc.
This release also includes some new examples:
- holaMundo.py - Spanish translation of HelloWorld
- sexpParser.py - S-exp parser
- jsonParser.py (update) - minor bug-fixes to previously released
example for parsing JSON (JavaScript Object Notation) object
serialization strings
- macroExpander.py - macro preprocessor to substitute defined macros
Download pyparsing 1.4.6 at http://sourceforge.net/projects/pyparsing/.
The pyparsing Wiki is at http://pyparsing.wikispaces.com
-- Paul
========================================
Pyparsing is a pure-Python class library for quickly developing
recursive-descent parsers. Parser grammars are assembled directly in
the calling Python code, using classes such as Literal, Word,
OneOrMore, Optional, etc., combined with operators '+', '|', and '^'
for And, MatchFirst, and Or. No separate code-generation or external
files are required. Pyparsing can be used in many cases in place of
regular expressions, with shorter learning curve and greater
readability and maintainability. Pyparsing comes with a number of
parsing examples, including:
- "Hello, World!" (English, Korean, Greek, and Spanish(new))
- chemical formulas
- configuration file parser
- web page URL extractor
- 5-function arithmetic expression parser
- subset of CORBA IDL
- chess portable game notation
- simple SQL parser
- Mozilla calendar file parser
- EBNF parser/compiler
- Python value string parser (lists, dicts, tuples, with nesting)
(safe alternative to eval)
- HTML tag stripper
- S-expression parser (new)
- macro substitution preprocessor (new)