diff options
author | Paul McGuire <ptmcg@austin.rr.com> | 2014-04-29 19:47:46 +0000 |
---|---|---|
committer | Paul McGuire <ptmcg@austin.rr.com> | 2014-04-29 19:47:46 +0000 |
commit | 745755952fca3e5f0529f43724126c7275fe91f1 (patch) | |
tree | 20541da9a7fc543a64ac47f4896becc922e2a6c2 /src/pyparsing.py | |
parent | 5ae16b154296cf30471f8e145b591f53caf84b17 (diff) | |
download | pyparsing-git-745755952fca3e5f0529f43724126c7275fe91f1.tar.gz |
Fixed escaping behavior in QuotedString. Formerly, only quotation
marks (or characters designated as quotation marks in the QuotedString
constructor) would be escaped. Now all escaped characters will be
escaped, and the escaping backslashes will be removed.
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r-- | src/pyparsing.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py index 7dfe104..c8db75a 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.0.2"
-__versionTime__ = "13 April 2014 12:10"
+__version__ = "2.0.3"
+__versionTime__ = "28 April 2014 17:10"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -1914,8 +1914,7 @@ class QuotedString(Token): self.pattern += (r'|(?:%s)' % re.escape(escQuote))
if escChar:
self.pattern += (r'|(?:%s.)' % re.escape(escChar))
- charset = ''.join(set(self.quoteChar[0]+self.endQuoteChar[0])).replace('^',r'\^').replace('-',r'\-')
- self.escCharReplacePattern = re.escape(self.escChar)+("([%s])" % charset)
+ self.escCharReplacePattern = re.escape(self.escChar)+"(.)"
self.pattern += (r')*%s' % re.escape(self.endQuoteChar))
try:
|