summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-09-24 17:04:13 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-09-24 17:04:13 +0000
commit68c2b32b49f0c25d67b5a2e91ef0d1039f287e8b (patch)
tree0e1f6b886ffd60f1a799b41f534f5141d0907bad
parent6316cc5922201d5157a3eedc92c319c99e7a8579 (diff)
downloadpyparsing-68c2b32b49f0c25d67b5a2e91ef0d1039f287e8b.tar.gz
Fixed bug in ParseResults.dump when keys were not strings. Also changed display of string values to show them in quotes, to help distinguish parsed numeric strings from parsed integers that have been converted to Python ints.
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@443 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
-rw-r--r--src/CHANGES5
-rw-r--r--src/pyparsing.py10
2 files changed, 12 insertions, 3 deletions
diff --git a/src/CHANGES b/src/CHANGES
index d5f59a2..b8530b2 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -6,6 +6,11 @@ Version 2.1.10 -
-------------------------------
- Added support for multiline test strings in runTests.
+- Fixed bug in ParseResults.dump when keys were not strings.
+ Also changed display of string values to show them in quotes,
+ to help distinguish parsed numeric strings from parsed integers
+ that have been converted to Python ints.
+
Version 2.1.9 - September, 2016
-------------------------------
diff --git a/src/pyparsing.py b/src/pyparsing.py
index 5517d02..e3b014e 100644
--- a/src/pyparsing.py
+++ b/src/pyparsing.py
@@ -61,7 +61,7 @@ The pyparsing module handles some of the problems that are typically vexing when
"""
__version__ = "2.1.10"
-__versionTime__ = "11 Sep 2016 16:20 UTC"
+__versionTime__ = "17 Sep 2016 16:37 UTC"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -868,7 +868,7 @@ class ParseResults(object):
out.append( indent+_ustr(self.asList()) )
if full:
if self.haskeys():
- items = sorted(self.items())
+ items = sorted((str(k), v) for k,v in self.items())
for k,v in items:
if out:
out.append(NL)
@@ -879,7 +879,7 @@ class ParseResults(object):
else:
out.append(_ustr(v))
else:
- out.append(_ustr(v))
+ out.append(repr(v))
elif any(isinstance(vv,ParseResults) for vv in self):
v = self
for i,vv in enumerate(v):
@@ -4993,6 +4993,10 @@ def infixNotation( baseExpr, opList, lpar=Suppress('('), rpar=Suppress(')') ):
binary, left- or right-associative. Parse actions can also be attached
to operator expressions. The generated parser will also recognize the use
of parentheses to override operator precedences (see example below).
+
+ Note: if you define a deep operator list, you may see performance issues
+ when using infixNotation. See L{ParserElement.enablePackrat} for a
+ mechanism to potentially improve your parser performance.
Parameters:
- baseExpr - expression representing the most basic element for the nested