summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add support for LR parsingleft_recursion_supportMax Fischer2021-07-301-20/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix misc. documentation typos (#280)luzpaz2021-05-142-5/+5
| | | Found via `codespell -q 3 -L ba,fourty,halp,inout,strng`
* Deprecate `locatedExpr` in favor of new `Located` classptmcg2020-12-241-6/+49
|
* Add IndentedBlock class; made vertical keyword arg more visible when ↵pyparsing_3.0.0b1ptmcg2020-11-021-15/+64
| | | | creating railroad diags; changed create_diagram from monkeypatch to included method on ParserElement; better debug exception if Dict is constructed with non-Group expression
* ParseResults.List class to support returning an actual list from a parse ↵ptmcg2020-10-242-536/+405
| | | | action, plus aslist and asdict args to Group and Dict classes to emit native Python types instead of ParseResults; also update repr() output of ParseResults to include the type name instead of just a bare tuple.
* Issue #244, fixed debug output to indicate correct parse location; updated ↵Paul McGuire2020-10-111-8/+72
| | | | setDebug output to include current text line and parse location
* Fixed bugs in Each with ZeroOrMore and OneOrMore (first matched element ↵ptmcg2020-10-111-0/+35
| | | | enclosed in extra nesting level; results names not maintained; did not handle mix with required expressions)
* Convert SyntaxWarnings to ValueError and TypeError exceptions; change ↵Paul McGuire2020-08-191-430/+311
| | | | diagnostics to an enum, and add enable_diag(), disable_diag() and enable_all_warnings() methods; clean up pyparsing imports in test_unit.py
* Add '*' markers to debug output to indicate cached parse expression ↵ptmcg2020-08-181-7/+80
| | | | try/pass/fail events (which were previously omitted from debugging output)
* Remove identChars override from Keyword.copy (#233)jgrey42962020-08-161-0/+5
|
* Better display of single-character WordsPaul McGuire2020-07-301-0/+4
|
* Add size spec to default Word repr outputPaul McGuire2020-07-301-12/+28
|
* Docstrings cleanup; add 'encoding' argument to parseFile; additional unit ↵ptmcg2020-07-081-0/+48
| | | | tests to improve ParseResults coverage
* infixNotation unit tests to address missing coverage and features; rename ↵ptmcg2020-07-071-4/+50
| | | | infixNotation tests to meaningful names
* Fixed traceback trimming, and added ParserElement.verbose_traceback ↵Paul McGuire2020-06-281-0/+2
| | | | save/restore to reset_pyparsing_context()
* Additional unit testspyparsing_3.0.0a2Paul McGuire2020-06-271-5/+91
|
* Assert packrat not enabled in base test case; log packrat status and cache ↵Paul McGuire2020-06-271-0/+22
| | | | type in all cases
* Blacken test_examples.pyptmcg2020-06-271-1/+1
|
* Add make_diagram.py to examples to demonstrate creating railroad diags for ↵ptmcg2020-06-271-1/+2
| | | | selected examples
* Blackeningptmcg2020-06-261-6/+18
|
* Restructure unit tests to do proper testing with and without packrat enabledptmcg2020-06-261-11/+26
|
* Revert to Python 3.7.1 for most compatibility; rewrite explain() unit test ↵ptmcg2020-06-261-9/+22
| | | | to be more tolerant of variations in TypeError str formatting
* Modify expected explain string to use Python version-specific TypeErrorptmcg2020-06-251-1/+8
|
* More thorough ParseException.explain testingptmcg2020-06-251-13/+62
|
* Add unit tests for miscellaneous ParseException methods/behaviorptmcg2020-06-251-0/+48
|
* Diagram improvements IV (#225)Michael Milton2020-06-241-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add diagram documentation, add more diagram tests, allow more customization of diagrams * Remove accidental edit of unrelated documentation * Add diagram package * Add jinja file to manifest * Add to bdist also * package_data * Railroad improvements * Partial rewrite * Update * Use partials everywhere so we can edit the tree before it's constructed * Rewrite the diagram generator to not duplicate any content; use monospaced font for titles * Small documentation change * Revert back to Python 3.5 type hints, fix a small bug * More diagram fixes * Even more pruning; update docs to use SQL example * Don't check the string value of names now that we don't have to
* Follow-up to default vs custom name tracking, from Issue #223ptmcg2020-06-241-18/+18
|
* warn_on_assignment_to_Forward not working on PyPy - disable test for now if ↵ptmcg2020-06-101-4/+5
| | | | running on PyPy
* warn_on_assignment_to_Forward not working on PyPy - disable test for now if ↵ptmcg2020-06-101-1/+6
| | | | running on PyPy
* Add new warnings about common errors using Forward: ↵ptmcg2020-06-091-15/+62
| | | | warn_on_parse_using_empty_Forward warns when failing to attach an expression; warn_on_assignment_to_Forward warns when using '=' instead of '<<='
* Additional configuration for `skipWhitespace` and `leaveWhitespace` (#219)Michael Milton2020-06-091-0/+91
| | | | | | | * Add .ignoreWhitespace() method * Add recursive arg to leave- and ignoreWhitespace(), with tests * Add tests and implementation of the recursive flag
* Railroad Diagram Improvements (#220)Michael Milton2020-06-031-0/+18
| | | | | | * Add diagram documentation, add more diagram tests, allow more customization of diagrams * Remove accidental edit of unrelated documentation
* Railroad Diagrams (#218)Michael Milton2020-05-311-0/+38
| | | | | | | | | | | | | * Basic framework * Initial effort * Clean up and document code * jinja newline * Pre-commit, and add extras to tox * We can't use the class type-annotations syntax in Python 3.5
* Add GoToColumn test (#217)Matt Carmody2020-05-311-0/+38
| | | | | * Add GoToColumn test * Update GoToColumn test with ptmcg's feedback
* Add misc unit tests for core elements with missing coverage (#214)Matt Carmody2020-05-181-0/+121
| | | | | | | | | | | | | | | | | * Expand testQuotedStrings * Add tests for expr[n] edge cases * Add ParserElement.ignore(str) test * Add Regex invalid type test * Add test for Word with min=0 * Add Char with asKeyword=True test * Add CharsNotIn tests * Remove unused __req__ and __rne__
* Imports cleanup in unit tests (#215)Matt Carmody2020-05-171-224/+119
| | | | | * Remove unused import & variables in tests * Remove exploded pyparsing imports
* Added unit test for modified countedArray metadata (#209)ptmcg2020-05-131-0/+61
|
* Parser Element and Keyword tests (#199)Matt Carmody2020-05-121-4/+263
| | | | | | | | | | | | | | | | | * Expand Keyword unit test * Add ParserElement add unit tests * Add ParserElement sub unit tests * Add ParserElement mul unit tests * Add ParserElement Match First unit tests * Add ParserElement Match Longest unit tests * Add ParserElement Each unit tests * Refactor and cleanup
* Pop counter token and return rest instead of dropping all tokens in ↵Marcin Jaworski2020-05-032-7/+7
| | | | | | | | | | | | | countedArray (#209) * Pop counter token and return rest instead of dropping all tokens * Include only named results from intExpr in countedArray results * Remove internal Group from countedArray * Fix operator precedence * Update countedArray tests
* Fixed bug in ParseResults repr() which showed all matching entries for a ↵ptmcg2020-04-101-0/+27
| | | | results name, even if listAllMatches was set to False (Issue #205)
* Enhanced error messages and error locations when parsing fails on the ↵ptmcg2020-04-031-1/+62
| | | | Keyword or CaselessKeyword classes due to the presence of a preceding or trailing keyword character. See issue #201.
* Refactor ParseException explain() static method into a staticmethod and an ↵Paul McGuire2020-03-311-7/+7
| | | | instance method on ParseBaseException
* Add OnlyOnce docstring, error message and unit test (#193)Matt Carmody2020-03-311-0/+31
|
* Add ParseResults unit tests (#198)Matt Carmody2020-03-311-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | * Add ParseResults.__new__() unit tests * Add reversed(ParseResults) unit test * Add ParseResults.values() unit test * Add ParseResults.append() unit test * Add ParseResults.clear() unit test * Add ParseResults.extend() unit tests * Add ParseResults.from_dict() unit test * Add dir(ParseResults) unit test * Add ParseResults.insert() unit test * Minor clean up * Fix dependency on dict order-preservation * Changes to incorporate notes
* Blacken unit test changesptmcg2020-03-221-13/+26
|
* Fixup matchPreviousExpr testsptmcg2020-03-221-67/+31
|
* New unit tests (#192)Matt Carmody2020-03-221-0/+196
| | | | | | | | | | | | | | | | | | | * Add tests for matchPreviousLiteral - question in comments * Bug fix - matchPreviousLiteral One line fix for scanString of matchPreviousLiteral with mulitple return tokens. Test still needs to be refactored. * Demo 3 issues in matchPreviousLiteral and matchPreviousExpr * Correct mistakes and demonstrate potential matchPreviousExpr issue * Add nestedExpr unit tests * Add makeXMLTags unit test * Add unit tests for oneOf with empty list and int input
* Housekeeping (#191)Matt Carmody2020-03-211-98/+40
| | | | | | | | | * Correct docstring typo in helpers.py * Remove repetitive imports of pyparsing in tests * Move repetitive pyparsing_common calls to module level ppc * Correct docstrings inline code typos
* Blacken changesptmcg2020-02-231-2/+7
|
* Fix bug in Each when using Regex, Regex would get parsed twice (issue #183)ptmcg2020-02-231-13/+44
|