summaryrefslogtreecommitdiff
path: root/pyparsing/testing.py
Commit message (Collapse)AuthorAgeFilesLines
* Add support for LR parsingleft_recursion_supportMax Fischer2021-07-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * first draft of LR parsing * removed debug output * cache is owned and cleared by ParserElement * bounded recursion must be enabled explicitly * packrat rejects recursion * basic LR unit test * tests for associativity and nesting * added math example * fixed test typo * unittest for empty and non-peg clauses * LR-Forward can match Empty * fixed test typos * added base case to unittest * memo cache only provides copies * flattened Forward parse method * added high-level description of algorithm * expanded docstring * added tests for repetition rules * renamed bounded to left recursion * naive test for existing suite * explicitly testing tests for LR compatibility * LR memo no longer mixes action/no-action results * simplified replacement logic * adjusted example with ambiguous failure case * LR memo content is always returned as copy * draft for peeking recursion * memo update consistent for all actions * fixed a bug for non-string token identifiers * action wins against no-action * cleanup * properly setting names in tests * memoization can be turned off * testing memo switches * typos * flattened recursion memo * left recursion memo size may be limited * adjusted docs for recursion cache
* Fixed traceback trimming, and added ParserElement.verbose_traceback ↵Paul McGuire2020-06-281-0/+4
| | | | save/restore to reset_pyparsing_context()
* Fix bug when using pyparsing_testing.reset_pyparsing_context as a context ↵Paul McGuire2020-06-271-1/+1
| | | | manager, suppressing raised exceptions
* Blackeningptmcg2020-06-261-1/+3
|
* Restructure unit tests to do proper testing with and without packrat enabledptmcg2020-06-261-2/+25
|
* Convert internal imports to relative imports, to support projects that ↵ptmcg2020-05-131-1/+1
| | | | vendor pyparsing
* Docstring formatting changes (#197)Matt Carmody2020-03-291-9/+10
| | | | | | | * Tidy docstring formatting for lists and example codeblock * Add class references and formatting to docstrings * Experimental docstring formatting changes
* Don't import unittest in testing.py (#196)Daniel Wagner-Hall2020-03-241-1/+0
| | | | | | | | | This import is currently unused in the file. I'm looking at optimising start-up times of a project I work on, and importing pyparsing currently takes about 82ms, which is quite a lot for my domain. Just not importing `unittest` shaves 14ms off of that import time.
* Rollforward infixNotation ternary op fix from 2.4.6 branch, plus related ↵ptmcg2020-01-041-2/+6
| | | | unit test; change TestParseResultsAsserts to mixin instead of subclass; rollforward 2.4.6 CHANGES blurb from 2.4.6 branch
* Break up pyparsing.py monolith into sub-modules in a pyparsing package (#162)Paul McGuire2019-11-181-0/+190
* Break up pyparsing.py monolith into sub-modules in a pyparsing package * Convert relative imports to absolutes * Reference submodule pyparsing in setup.py modules * Remove recursive import of pyparsing from setup.py * Black updates * setup.py updates - packages vs. modules. use .dev1 for the version