summaryrefslogtreecommitdiff
path: root/pyparsing
Commit message (Collapse)AuthorAgeFilesLines
...
* Additional docstring and sphinx cleanupptmcg2022-06-183-9/+21
|
* Replace OrderedDict in FIFOCache with dict+key ringbufferptmcg2022-06-181-3/+8
|
* More docstring fixesptmcg2022-06-171-4/+7
|
* There will be blackptmcg2022-06-172-3/+1
|
* Explicitly declare compatibility alias functions (#414)Devin J. Pohly2022-06-174-90/+203
| | | | | This allows static type checkers to find and check these functions correctly, and it removes the need to fiddle around with stack frames to get the aliases defined.
* Docstring cleanups in col and lineno functionsptmcg2022-06-171-2/+2
|
* Fix docstring synonyms for parseString, scanString, et al.; refactor ↵ptmcg2022-06-172-18/+44
| | | | replaces_prePEP8_function decorator to handle new methods correctly
* Add mypy ignore directives for intentional Python rule-bendingptmcg2022-06-162-11/+14
|
* Cleanup docstrings using replaces_prePEP8_function decorator; and blackptmcg2022-06-162-31/+36
|
* Use Literal.__new__ to select optimized subclasses (#413)Devin J. Pohly2022-06-161-19/+37
| | | | | | | | | | | | | | | | | | | * Use Literal.__new__ to select optimized subclasses This turns Literal() into a factory which creates an object of the appropriate type from the start, rather than having to overwrite the __class__ attribute later. * Fix Literal.__copy__() Instance attributes from superclasses weren't being transferred to the copy. Regression test included. * Make Empty a subclass of Literal This unifies the logic with other optimized literal classes like _SingleCharLiteral, and it seemed right in terms of a type relationship. * Style
* Clean up docstrings to use new PEP8 names instead of old camelCase namesptmcg2022-06-161-1/+1
|
* Clean up docstrings to use new PEP8 names instead of old camelCase namesptmcg2022-06-163-18/+18
|
* More docstring fixup, in exceptions.py - issue #411ptmcg2022-06-161-3/+2
|
* Fix up docstrings for deprecated functions (doc as deprecated, instead of ↵ptmcg2022-06-166-56/+97
| | | | duplicating actual function doc) - issue #411
* fix Sphinx errors/warnings (#410)Devin J. Pohly2022-06-103-8/+12
| | | | | | Two warnings remain from the Hebrew and Devanagari names in pyparsing_unicode, but those are due to Sphinx using Python's builtin `re` library to parse identifiers (which does not have thorough Unicode handling for `\w`).
* Fix Word(max=2) (issue #409); create re for Word(exact=n) exprs; validate ↵ptmcg2022-06-102-23/+33
| | | | that min <= max if both given
* Clean up unicode set naming to remove # type: ignore directivesptmcg2022-06-081-23/+22
|
* Fix list formatting in docstrings (#407)Devin J. Pohly2022-06-071-26/+37
| | | | | | | | | * Fix list formatting in docstrings A few docstrings were missing a blank line before lists, causing the start of the list to be parsed by RST as a continuation of the previous line. * add backticks to parameter names in lists
* Convert most str.format() calls to use f-stringsptmcg2022-05-308-194/+103
|
* More added type annotations; reworked Word.__init__ so that excludeChars ↵ptmcg2022-05-294-54/+66
| | | | exclusion code is clearer
* Fix/ignore mypy attr-defined errors, where attr definitions are intentionalptmcg2022-05-294-19/+22
|
* Fix type annotations of Forward dunder-methods (#402)Stephen Rosen2022-05-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix type annotations of Forward dunder-methods The `__lshift__`, `__ilshift__`, and `__or__` methods each return a ParserElement object, but have no annotated return type. The result is that the following code will not type check: def foo() -> pp.ParserElement: expr = pp.Forward() expr <<= bar() return expr | pp.Literal("baz") whereas the code will type check if the return line is changed to return pp.MatchFirst([expr, pp.Literal("baz")]) This is a bug in the types which can be resolved fairly simply with some return type annotations. Testing is more complicated. Testing annotation accuracy is a relatively novel space with a few options, none of which can be considered standard as of yet. Many solutions require learning a new toolchain only for that purpose. However, one of the lower-impact options is to use `mypy --warn-unused-ignores` to check that annotations satisfy some constraints. This isn't the most precise test possible, but it's simple and uses a widely known and familiar tool for the job. `tox -e mypy-tests` is a new tox env which calls `mypy` in the desired way. We can confirm with a new test case file that `tox -e mypy-tests` fails prior to this change to `pyparsing/` and that it passes with the change made. * Comment out mypy-test tox env for CI Until CI adjustments are made, it's not possible to add mypy-test to the tox config. It will be run under pypy where it does not work until other changes are made.
* Cleaned up/expanded some docstrings and docs to reflect new 3.0.10 changesptmcg2022-05-201-0/+5
|
* Add embed argument to create_diagram, to suppress DOCTYPE, HEAD, and BODY tagsptmcg2022-05-202-5/+14
|
* Make expr[:ender] equivalent to expr[...:ender]ptmcg2022-05-181-2/+4
|
* Add support for slice in expr[] notation, to pass stop_on repetition sentinelptmcg2022-05-182-1/+21
|
* Fixed bug in srange (escaped chars inside range set); fixed ignore type ↵ptmcg2022-05-142-6/+6
| | | | annotation in SkipTo
* Prep for 3.0.9 releaseptmcg2022-05-051-1/+1
|
* Embedded jinja2 template code in railroad code to remove use of deprecated ↵ptmcg2022-04-302-29/+30
| | | | pkg_resources package (issue #391)
* Expanded BMP name to BasicMultilingualPlane (but retained BMP as a valid ↵ptmcg2022-04-302-2/+4
| | | | synonym)
* Added BMP unicode_set for the Unicode Basic Multilingual Plane (issue #392)ptmcg2022-04-281-5/+23
|
* Fixed typo in template.jinja2 (for railroad diagrams) - fixes #388)ptmcg2022-04-222-2/+2
|
* Update docstrings, replacing ZeroOrMore and OneOrMore with [...] and [1, ↵ptmcg2022-04-114-27/+27
| | | | ...] notation
* Reworked mypy typing, removed definitions of OptionalType, DictType, and ↵ptmcg2022-04-115-72/+83
| | | | IterableType
* Don't import Optional from typing, import the whole module. (#386)Dominic Davis-Foster2022-04-111-2/+2
| | | Addresses mypy confusion of pyparsing Optional and typing.Optional
* Added show_groups arg to create_diagram; prep for releasepyparsing_3.0.8ptmcg2022-04-093-3/+19
|
* No longer use undocumented module "sre_constants" (#379)Serhiy Storchaka2022-03-292-5/+4
| | | Closes #378.
* Fix issue #361ptmcg2022-03-292-3/+7
|
* Add tests and updated docs for changes to lpar and rpar args to ↵ptmcg2022-03-271-1/+1
| | | | infix_notation; add grouping of non-suppressed tokens with grouped contents
* Add tests and updated docs for changes to lpar and rpar args to ↵ptmcg2022-03-243-8/+19
| | | | infix_notation; add grouping of non-suppressed tokens with grouped contents
* Fix bug #375 (#376)Philippe PRADOS2022-03-241-2/+4
|
* Add guard inside _trim_arity to protect against black reformatting in ↵ptmcg2022-03-212-10/+7
| | | | spacing-critical code
* Add missing type hints (#371)Kazantcev Andrey2022-03-201-17/+17
| | | | | * Add missing type hints * Yet another fixes
* Black and pre-commit fixesptmcg2022-02-151-8/+11
|
* Clean up dump() examples in docstringsptmcg2022-02-153-29/+29
|
* Updated version number for development; blackening; some timestamp cleanupptmcg2022-02-153-5/+10
|
* Mark `pyparsing` as a typed package (#364)Bas van Beek2022-02-141-0/+0
| | | Thanks for adding this. The typing ecosystem is still pretty dynamic.
* Update CHANGES and timestamp from #362; fix related unit test and ValueError ↵Paul McGuire2022-02-052-4/+3
| | | | message
* Update CHANGES and timestamp from #362Paul McGuire2022-02-051-1/+1
|
* optimize pyparsing import time by deferring regex compile (#363)Anthony Sottile2022-02-051-14/+36
|