summaryrefslogtreecommitdiff
path: root/src/pyparsing.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2016-09-24 17:04:13 +0000
committerPaul McGuire <ptmcg@austin.rr.com>2016-09-24 17:04:13 +0000
commit80668b5ffe76af2912791ba5c227cd35ebad8c2d (patch)
tree0e1f6b886ffd60f1a799b41f534f5141d0907bad /src/pyparsing.py
parent7d3417bf20295c6bec7fd611d3d3bc0fdce255ef (diff)
downloadpyparsing-git-80668b5ffe76af2912791ba5c227cd35ebad8c2d.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.
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r--src/pyparsing.py10
1 files changed, 7 insertions, 3 deletions
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