diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2016-02-23 22:17:23 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2016-02-23 22:17:23 +0000 |
commit | 4761de7d4ea5839b76d1a1e6ea98419915134ae7 (patch) | |
tree | e6c89150c09856dc5e2faa8bf38478dc0774b9a6 /src/pyparsing.py | |
parent | 05c33544679be61a013c57c6bde342aa1124dcee (diff) | |
download | pyparsing-git-4761de7d4ea5839b76d1a1e6ea98419915134ae7.tar.gz |
Fixed bug in Each introduced in 2.1.0
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r-- | src/pyparsing.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py index 849473f..61bfc21 100644 --- a/src/pyparsing.py +++ b/src/pyparsing.py @@ -58,7 +58,7 @@ The pyparsing module handles some of the problems that are typically vexing when """
__version__ = "2.1.1"
-__versionTime__ = "21 Feb 2016 19:41"
+__versionTime__ = "23 Feb 2016 16:16"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -2622,14 +2622,16 @@ class Each(ParseExpression): tmpExprs = tmpReqd + tmpOpt + self.multioptionals + self.multirequired
failed = []
for e in tmpExprs:
- if e.canParseNext(instring, tmpLoc):
+ try:
+ tmpLoc = e.tryParse( instring, tmpLoc )
+ except ParseException:
+ failed.append(e)
+ else:
matchOrder.append(self.opt1map.get(id(e),e))
if e in tmpReqd:
tmpReqd.remove(e)
elif e in tmpOpt:
tmpOpt.remove(e)
- else:
- failed.append(e)
if len(failed) == len(tmpExprs):
keepMatching = False
|