diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2015-12-17 10:12:34 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2015-12-17 10:12:34 +0000 |
commit | bb85a2668d57429c69dd489cdd42d4641654e1a8 (patch) | |
tree | de5b841c3f7b021454fbbcd898d339f8a3da3d1e /src/pyparsing.py | |
parent | 019fffcc5de6954cc74f42449ceb16bf9ed572f2 (diff) | |
download | pyparsing-git-bb85a2668d57429c69dd489cdd42d4641654e1a8.tar.gz |
Fixed bug in ignore() (introduced in pyparsing 1.5.3) that would not accept a string literal as the ignore expression.
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r-- | src/pyparsing.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py index 9d697dd..2fee683 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.0.7"
-__versionTime__ = "13 Dec 2015 13:09"
+__versionTime__ = "17 Dec 2015 04:11"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -1452,9 +1452,12 @@ class ParserElement(object): matching; may be called repeatedly, to define multiple comment or other
ignorable patterns.
"""
+ if isinstance(other, basestring):
+ other = Suppress(other)
+
if isinstance( other, Suppress ):
if other not in self.ignoreExprs:
- self.ignoreExprs.append( other.copy() )
+ self.ignoreExprs.append(other)
else:
self.ignoreExprs.append( Suppress( other.copy() ) )
return self
|