summaryrefslogtreecommitdiff
path: root/src/pyparsing.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-09-28 00:51:09 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-09-28 00:51:09 +0000
commit8a30afc12d6f3b93e56238ea791251bcccc87a82 (patch)
tree6ae1b98022a467a27496279b32a57a1d8cb6e0bd /src/pyparsing.py
parent68c2b32b49f0c25d67b5a2e91ef0d1039f287e8b (diff)
downloadpyparsing-8a30afc12d6f3b93e56238ea791251bcccc87a82.tar.gz
Fix bug in ZeroOrMore results name reporting
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@444 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r--src/pyparsing.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py
index e3b014e..e1648b5 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__ = "17 Sep 2016 16:37 UTC"
+__versionTime__ = "28 Sep 2016 00:47 UTC"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -3800,6 +3800,7 @@ class NotAny(ParseElementEnhance):
class _MultipleMatch(ParseElementEnhance):
def __init__( self, expr, stopOn=None):
super(_MultipleMatch, self).__init__(expr)
+ self.saveAsList = True
ender = stopOn
if isinstance(ender, basestring):
ender = ParserElement._literalStringClass(ender)
@@ -3869,11 +3870,6 @@ class OneOrMore(_MultipleMatch):
return self.strRepr
- def setResultsName( self, name, listAllMatches=False ):
- ret = super(OneOrMore,self).setResultsName(name,listAllMatches)
- ret.saveAsList = True
- return ret
-
class ZeroOrMore(_MultipleMatch):
"""
Optional repetition of zero or more of the given expression.
@@ -3950,6 +3946,7 @@ class Optional(ParseElementEnhance):
"""
def __init__( self, expr, default=_optionalNotMatched ):
super(Optional,self).__init__( expr, savelist=False )
+ self.saveAsList = self.expr.saveAsList
self.defaultValue = default
self.mayReturnEmpty = True