summaryrefslogtreecommitdiff
path: root/src/pyparsing.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2016-08-11 19:59:56 +0000
committerPaul McGuire <ptmcg@austin.rr.com>2016-08-11 19:59:56 +0000
commitca08a825b5d419e5ee64d2b8ccabef17b7bac19f (patch)
treeb0bec6d87e1ff4cac8e201ed888c3bac7b17294b /src/pyparsing.py
parent24f27a03b9eb85cec4fcf8939c73cff9d80f038c (diff)
downloadpyparsing-git-ca08a825b5d419e5ee64d2b8ccabef17b7bac19f.tar.gz
Fixed bug in ParserElement.inlineLiteralsUsing, causing infinite loop with Suppress;
added AutoReset context manager class to unit tests, for saving/resetting global state when tests need to change globals
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r--src/pyparsing.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py
index b335f95..86d5c21 100644
--- a/src/pyparsing.py
+++ b/src/pyparsing.py
@@ -57,8 +57,8 @@ The pyparsing module handles some of the problems that are typically vexing when
- embedded comments
"""
-__version__ = "2.1.7"
-__versionTime__ = "11 Aug 2016 07:29 UTC"
+__version__ = "2.1.8"
+__versionTime__ = "11 Aug 2016 19:09 UTC"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -3557,7 +3557,10 @@ class ParseElementEnhance(ParserElement):
def __init__( self, expr, savelist=False ):
super(ParseElementEnhance,self).__init__(savelist)
if isinstance( expr, basestring ):
- expr = ParserElement._literalStringClass(expr)
+ if issubclass(ParserElement._literalStringClass, Token):
+ expr = ParserElement._literalStringClass(expr)
+ else:
+ expr = ParserElement._literalStringClass(Literal(expr))
self.expr = expr
self.strRepr = None
if expr is not None: