summaryrefslogtreecommitdiff
path: root/src/pyparsing.py
Commit message (Collapse)AuthorAgeFilesLines
...
* _TTLCache logic cleanup, add get() method similar to dict.get ptmcg2016-07-271-7/+10
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@374 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Redo packrat cache to use _TTLCache instead of dict, to permit cache size ↵ptmcg2016-07-261-21/+95
| | | | | | constraints git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@373 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed bug in pyparsing_common.numeric, integers were parsed as floatsptmcg2016-06-181-3/+3
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@371 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added ParserElement.split() generator methodptmcg2016-06-131-1/+17
| | | | | | Also fixed minor blip in originalTextFor, to inherit ignored exprs from the embedded expression. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@369 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fix docstring formatting for epydocptmcg2016-06-121-5/+5
| | | | | | Cleaned up expression naming in pyparsing_common git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@368 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fix docstring formatting for epydocptmcg2016-06-121-2/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@367 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Change result value returned by runTests to be a list of (test,result) tuplesptmcg2016-06-121-16/+39
| | | | | | | | | Add pyparsing_common helpers convertToDate and convertToDatetime Add named regex fields to iso8601_date and iso8601_datetime Fix pyparsing_common method stripHTMLTags Corresponding cleanups in unittests git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@364 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Add names to new pyparsing_common fraction expressionsptmcg2016-06-081-3/+3
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@363 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Update version timestampptmcg2016-06-081-1/+1
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@362 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Add support in pyparsing_common for fractions and mixed integer-fraction valuesptmcg2016-06-081-5/+13
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@361 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added pyparsing_common.stripHTMLTags; added links to pyparsing_common docstring ptmcg2016-06-021-7/+15
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@360 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added tokenMap parse action helper; general code cleanup; renamed ↵ptmcg2016-05-241-62/+113
| | | | | | literalStringClass to _literalStringClass throughout git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@358 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Updated comments in pyparsing_common and CHANGESptmcg2016-05-181-1/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@357 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Add hex_integer to pyparsing_commonptmcg2016-05-181-0/+3
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@356 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* runTests changes: made parseAll=True the default; added support for failure ↵ptmcg2016-05-181-15/+17
| | | | | | | | tests; always return success,results tuple revamp unitTests to use new failureTests arg git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@355 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Add UUID to pyparsing_commonptmcg2016-05-181-2/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@354 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added more expressions to pyparsing_common: IPv4 and IPv6 addresses ↵ptmcg2016-05-181-3/+23
| | | | | | (including long, short, and mixed forms of IPv6; MAC address; ISO8601 date and date time strings git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@353 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Some docstring cleanup for better epydoc outputptmcg2016-05-141-10/+11
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@350 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added 'fatal' option to addCondition; enhancements to runTests, and added ↵ptmcg2016-05-131-16/+39
| | | | | | unit test for runTests git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@348 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fix Py3 incompatibility in traceParseActionptmcg2016-05-131-2/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@347 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Minor enhancement to traceParseAction decorator, to retain the parse ↵ptmcg2016-05-131-1/+11
| | | | | | | | action's name for the trace output Some rework of unitTests.py, to simplify test suite building git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@346 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Add epydoc docstrings to new expressions in pyparsing_commonptmcg2016-05-131-3/+11
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@345 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Split out the '==' behavior in ParserElement, now implemented as the ↵ptmcg2016-05-121-39/+131
| | | | | | | | | | matches() method. Added support for embedded comments in test string passed to runTests. Reworked embedded tests to include comments. Added 'pyparsing_common' class containing common/helpful little expressions. Added embedded demonstration tests. Reworked extraction of system.version for Py2/3-specific processing. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@344 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Update version timestampptmcg2016-05-111-1/+1
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@341 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* traceback module variations between Py3.5.0 and Py3.5.1ptmcg2016-05-111-2/+5
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@340 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fix trim_arity handling of Python 2 vs 3 traceback data; changed in 3.5, not ↵ptmcg2016-05-111-6/+7
| | | | | | 3.0, so earlier Py3 versions use data as-is from traceback module git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@339 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed similar backtracking issues in the C and C++ style commentsptmcg2016-04-291-4/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@336 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed catastrophic regex backtracking in implementation of the quoted string ↵ptmcg2016-04-291-4/+5
| | | | | | expressions (dblQuotedString, sglQuotedString, and quotedString) git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@335 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fix bug in _trim_arity when pyparsing is part of a PyInstaller (which leaves ↵ptmcg2016-04-221-5/+26
| | | | | | out the source code), replaced using traceback module extract_stack/extract_tb calls. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@334 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fix timestamp for releaseptmcg2016-03-211-1/+1
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@332 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Cleanup docstring changes to QuotedString for epydoc processingptmcg2016-03-211-3/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@331 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added default behavior to QuotedString to convert embedded '\t', '\n', etc. ↵ptmcg2016-03-191-2/+15
| | | | | | characters to their whitespace counterparts; added support in new init arg, convertWhitespaceEscapes. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@330 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed bug in ParseResults.toDict(), in which dict values were always ↵ptmcg2016-03-061-2/+12
| | | | | | converted to dicts, even if they were just unkeyed lists of tokens. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@329 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed bug in Each introduced in 2.1.0ptmcg2016-02-231-4/+6
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@328 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed bug in SkipTo when using failOn; replaced explicit references to ↵ptmcg2016-02-221-4/+4
| | | | | | obj.__dict__ with vars(obj) (several places); tightened up unit tests for SkipTo git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@327 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Removed use of partial in replaceWith, for PyPy compatibility. Removed ↵ptmcg2016-02-161-21/+2
| | | | | | no-longer-used method getTokensEndLoc (was part of keepOriginalText, previously deprecated and deleted). git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@326 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added support for assigning to ParseResults using slices; reimplemented ↵ptmcg2016-02-151-7/+4
| | | | | | originalTextFor using sliced assignment git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@325 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added stopOn arg to ZeroOrMore and OneOrMore; refactored/cleaned up SkipTo ↵ptmcg2016-02-071-97/+128
| | | | | | to reduce exception-based flow of control (using new ParserElement.canParseNext); made toklist a default arg so ParseResults can now be constructed using an empty constructor; fleshed out some docstrings with parameter lists git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@322 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Removed deprecated class Upcase and deprecated class keepOriginalText; ↵ptmcg2016-02-071-28/+3
| | | | | | updated examples to remove those symbols, and to replace operatorPrecedence with infixNotation git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@320 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Switched version number to 2.1.0ptmcg2016-02-071-2/+2
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@319 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Add support for pickling ParseResults with protocols 2 and higher (default ↵ptmcg2016-02-061-1/+6
| | | | | | protocol in Py3 is 3) git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@318 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed ParseResults.asDict() to correctly convert nested ParseResults values ↵ptmcg2016-01-231-4/+9
| | | | | | | | to dicts. Fixed ParseResults.__radd__ to return other+self if not adding to 0. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@315 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fix _trim_arity to distinguish between TypeErrors raised in parse actions ↵ptmcg2016-01-181-6/+18
| | | | | | and those raised during internal arity testing git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@313 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* More internal expression naming, in internal elements of infixNotationptmcg2016-01-011-3/+4
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@312 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Added expression names for many internal and builtin expressions, to reduce ↵ptmcg2015-12-311-20/+25
| | | | | | name and error message overhead during parsing git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@311 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed bug in ignore() (introduced in pyparsing 1.5.3) that would not accept ↵ptmcg2015-12-171-2/+5
| | | | | | a string literal as the ignore expression. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@306 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Fixed up implementations of __dir__ to reduce maintenance overhead, and fix ↵ptmcg2015-12-131-4/+3
| | | | | | output of ParseResults instance dirs. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@305 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Remove duplicated codeptmcg2015-12-071-1/+0
| | | | git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@304 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Cleaned up additional issues from enhancing the error messages for Or and ↵ptmcg2015-11-251-13/+6
| | | | | | MatchFirst, handling Unicode values in expressions. Fixes Unicode encoding issues in Python 2. git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@303 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
* Simplified string representation of Forward, to avoid memory and performance ↵ptmcg2015-11-251-2/+4
| | | | | | issues during streamlining git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@302 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b