diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2019-08-25 21:50:44 -0500 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2019-08-25 21:50:44 -0500 |
commit | 0369973e0969a1669631de08e603bc6681f3d7d1 (patch) | |
tree | 768f416defafda38a2e1f87ff3461854bad78bbc | |
parent | 99ea242512c3d625f6f94775afbb9d4642600615 (diff) | |
download | pyparsing-git-0369973e0969a1669631de08e603bc6681f3d7d1.tar.gz |
Make next release 3.0.0 instead of 2.5.0 to reflect Py3-only; fix warning message; minor improvement when default literal string class is other than Literal; always add extra newline after dump()
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | pyparsing.py | 13 |
2 files changed, 8 insertions, 7 deletions
@@ -2,7 +2,7 @@ Change Log ========== -Version 2.5.0a1 +Version 3.0.0a1 --------------- - Removed Py2.x support and other deprecated features. Pyparsing now requires Python 3.5 or later. If you are using an earlier diff --git a/pyparsing.py b/pyparsing.py index 49b15a8..c2f1f5a 100644 --- a/pyparsing.py +++ b/pyparsing.py @@ -95,8 +95,8 @@ classes inherit from. Use the docstrings for examples of how to: namespace class """ -__version__ = "2.5.0a1" -__versionTime__ = "19 Aug 2019 03:39 UTC" +__version__ = "3.0.0a1" +__versionTime__ = "26 Aug 2019 01:46 UTC" __author__ = "Paul McGuire <ptmcg@users.sourceforge.net>" import string @@ -2579,10 +2579,9 @@ class ParserElement(object): out.append("{0} failed: {1}: {2}".format(postParse.__name__, type(e).__name__, e)) else: out.append(result.dump(full=fullDump)) + out.append('') if printResults: - if fullDump: - out.append('') print_('\n'.join(out)) allResults.append((t, result)) @@ -4014,8 +4013,8 @@ class Or(ParseExpression): if __diag__.warn_multiple_tokens_in_named_alternation: if any(isinstance(e, And) for e in self.exprs): warnings.warn("{0}: setting results name {1!r} on {2} expression " - "may only return a single token for an And alternative, " - "in future will return the full list of tokens".format( + "will return a list of all parsed tokens in an And alternative, " + "in prior versions only the first token was returned".format( "warn_multiple_tokens_in_named_alternation", name, type(self).__name__), stacklevel=3) @@ -4278,6 +4277,8 @@ class ParseElementEnhance(ParserElement): if isinstance(expr, str_type): if issubclass(self._literalStringClass, Token): expr = self._literalStringClass(expr) + elif issubclass(type(self), self._literalStringClass): + expr = Literal(expr) else: expr = self._literalStringClass(Literal(expr)) self.expr = expr |