diff options
author | robot-piglet <[email protected]> | 2025-04-09 07:40:48 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-04-09 07:51:09 +0300 |
commit | 7ee6130d3c522b8f012d2e2e4366bb423c5c7574 (patch) | |
tree | 7ce2f4d60fdd8fda57e140882a574b0659131add /contrib/python/pyparsing | |
parent | 69788d332aa360e125ebdddf28ec62e0248ab73d (diff) |
Intermediate changes
commit_hash:09b286f52f83fbff697b82af94ef317af646e3f6
Diffstat (limited to 'contrib/python/pyparsing')
-rw-r--r-- | contrib/python/pyparsing/py3/.dist-info/METADATA | 2 | ||||
-rw-r--r-- | contrib/python/pyparsing/py3/pyparsing/__init__.py | 4 | ||||
-rw-r--r-- | contrib/python/pyparsing/py3/pyparsing/helpers.py | 27 | ||||
-rw-r--r-- | contrib/python/pyparsing/py3/ya.make | 2 |
4 files changed, 23 insertions, 12 deletions
diff --git a/contrib/python/pyparsing/py3/.dist-info/METADATA b/contrib/python/pyparsing/py3/.dist-info/METADATA index ed52278486a..d03671b6130 100644 --- a/contrib/python/pyparsing/py3/.dist-info/METADATA +++ b/contrib/python/pyparsing/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pyparsing -Version: 3.2.2 +Version: 3.2.3 Summary: pyparsing module - Classes and methods to define and execute parsing grammars Author-email: Paul McGuire <[email protected]> Requires-Python: >=3.9 diff --git a/contrib/python/pyparsing/py3/pyparsing/__init__.py b/contrib/python/pyparsing/py3/pyparsing/__init__.py index fa1f2abe67e..d839fd25375 100644 --- a/contrib/python/pyparsing/py3/pyparsing/__init__.py +++ b/contrib/python/pyparsing/py3/pyparsing/__init__.py @@ -120,8 +120,8 @@ class version_info(NamedTuple): return f"{__name__}.{type(self).__name__}({', '.join('{}={!r}'.format(*nv) for nv in zip(self._fields, self))})" -__version_info__ = version_info(3, 2, 2, "final", 1) -__version_time__ = "22 Mar 2025 22:09 UTC" +__version_info__ = version_info(3, 2, 3, "final", 1) +__version_time__ = "25 Mar 2025 01:38 UTC" __version__ = __version_info__.__version__ __versionTime__ = __version_time__ __author__ = "Paul McGuire <[email protected]>" diff --git a/contrib/python/pyparsing/py3/pyparsing/helpers.py b/contrib/python/pyparsing/py3/pyparsing/helpers.py index 7f62df86374..2badd68d64f 100644 --- a/contrib/python/pyparsing/py3/pyparsing/helpers.py +++ b/contrib/python/pyparsing/py3/pyparsing/helpers.py @@ -418,6 +418,8 @@ def locatedExpr(expr: ParserElement) -> ParserElement: ) +# define special default value to permit None as a significant value for +# ignore_expr _NO_IGNORE_EXPR_GIVEN = NoMatch() @@ -498,11 +500,13 @@ def nested_expr( """ if ignoreExpr != ignore_expr: ignoreExpr = ignore_expr if ignoreExpr is _NO_IGNORE_EXPR_GIVEN else ignoreExpr + if ignoreExpr is _NO_IGNORE_EXPR_GIVEN: ignoreExpr = quoted_string() if opener == closer: raise ValueError("opening and closing strings cannot be the same") + if content is None: if isinstance(opener, str_type) and isinstance(closer, str_type): opener = typing.cast(str, opener) @@ -519,8 +523,11 @@ def nested_expr( ) ) else: - content = empty.copy() + CharsNotIn( - opener + closer + ParserElement.DEFAULT_WHITE_CHARS + content = Combine( + Empty() + + CharsNotIn( + opener + closer + ParserElement.DEFAULT_WHITE_CHARS + ) ) else: if ignoreExpr is not None: @@ -544,10 +551,12 @@ def nested_expr( raise ValueError( "opening and closing arguments must be strings if no content expression is given" ) - if ParserElement.DEFAULT_WHITE_CHARS: - content.set_parse_action( - lambda t: t[0].strip(ParserElement.DEFAULT_WHITE_CHARS) - ) + + # for these internally-created context expressions, simulate whitespace-skipping + if ParserElement.DEFAULT_WHITE_CHARS: + content.set_parse_action( + lambda t: t[0].strip(ParserElement.DEFAULT_WHITE_CHARS) + ) ret = Forward() if ignoreExpr is not None: @@ -556,7 +565,9 @@ def nested_expr( ) else: ret <<= Group(Suppress(opener) + ZeroOrMore(ret | content) + Suppress(closer)) + ret.set_name(f"nested {opener}{closer} expression") + # don't override error message from content expressions ret.errmsg = None return ret @@ -621,7 +632,7 @@ def _makeTags(tagStr, xml, suppress_LT=Suppress("<"), suppress_GT=Suppress(">")) def make_html_tags( - tag_str: Union[str, ParserElement] + tag_str: Union[str, ParserElement], ) -> tuple[ParserElement, ParserElement]: """Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, @@ -648,7 +659,7 @@ def make_html_tags( def make_xml_tags( - tag_str: Union[str, ParserElement] + tag_str: Union[str, ParserElement], ) -> tuple[ParserElement, ParserElement]: """Helper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. diff --git a/contrib/python/pyparsing/py3/ya.make b/contrib/python/pyparsing/py3/ya.make index a53ebf37ecf..13dd585e164 100644 --- a/contrib/python/pyparsing/py3/ya.make +++ b/contrib/python/pyparsing/py3/ya.make @@ -4,7 +4,7 @@ PY3_LIBRARY() PROVIDES(pyparsing) -VERSION(3.2.2) +VERSION(3.2.3) LICENSE(MIT) |