summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2022-06-18 00:41:27 -0500
committerptmcg <ptmcg@austin.rr.com>2022-06-18 00:41:27 -0500
commit9b55d36f934537d95727aba1c076630b7f877ce0 (patch)
tree83253f812c2ac5e0c6067c21df5101fd6ac0519d
parent3394e81df2c8cb4b1449834c9367d5f7cf6a819f (diff)
downloadpyparsing-git-9b55d36f934537d95727aba1c076630b7f877ce0.tar.gz
Additional docstring and sphinx cleanup
-rw-r--r--docs/conf.py2
-rw-r--r--pyparsing/actions.py24
-rw-r--r--pyparsing/core.py4
-rw-r--r--pyparsing/helpers.py2
4 files changed, 22 insertions, 10 deletions
diff --git a/docs/conf.py b/docs/conf.py
index ce571f9..5f5bd8a 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -21,7 +21,7 @@ from pyparsing import __version__ as pyparsing_version
# -- Project information -----------------------------------------------------
project = "PyParsing"
-copyright = "2018-2021, Paul T. McGuire"
+copyright = "2018-2022, Paul T. McGuire"
author = "Paul T. McGuire"
# The short X.Y version
diff --git a/pyparsing/actions.py b/pyparsing/actions.py
index 8a91e1a..ca6e4c6 100644
--- a/pyparsing/actions.py
+++ b/pyparsing/actions.py
@@ -1,7 +1,7 @@
# actions.py
from .exceptions import ParseException
-from .util import col
+from .util import col, replaced_by_pep8
class OnlyOnce:
@@ -198,8 +198,20 @@ def with_class(classname, namespace=""):
# pre-PEP8 compatibility symbols
-replaceWith = replace_with
-removeQuotes = remove_quotes
-withAttribute = with_attribute
-withClass = with_class
-matchOnlyAtCol = match_only_at_col
+# fmt: off
+@replaced_by_pep8(replace_with)
+def replaceWith(): ...
+
+@replaced_by_pep8(remove_quotes)
+def removeQuotes(): ...
+
+@replaced_by_pep8(with_attribute)
+def withAttribute(): ...
+
+@replaced_by_pep8(with_class)
+def withClass(): ...
+
+@replaced_by_pep8(match_only_at_col)
+def matchOnlyAtCol(): ...
+
+# fmt: on
diff --git a/pyparsing/core.py b/pyparsing/core.py
index f0712c7..e182f9b 100644
--- a/pyparsing/core.py
+++ b/pyparsing/core.py
@@ -1360,11 +1360,11 @@ class ParserElement(ABC):
Hello, World! -> ['Hello', ',', 'World', '!']
- ``...`` may be used as a parse expression as a short form of :class:`SkipTo`.
+ ``...`` may be used as a parse expression as a short form of :class:`SkipTo`::
Literal('start') + ... + Literal('end')
- is equivalent to:
+ is equivalent to::
Literal('start') + SkipTo('end')("_skipped*") + Literal('end')
diff --git a/pyparsing/helpers.py b/pyparsing/helpers.py
index 6dcd3d4..802389c 100644
--- a/pyparsing/helpers.py
+++ b/pyparsing/helpers.py
@@ -906,7 +906,7 @@ def infix_notation(
def indentedBlock(blockStatementExpr, indentStack, indent=True, backup_stacks=[]):
"""
- (DEPRECATED - use IndentedBlock class instead)
+ (DEPRECATED - use ``IndentedBlock`` class instead)
Helper method for defining space-delimited indentation blocks,
such as those used to define block statements in Python source code.