summaryrefslogtreecommitdiff
path: root/pyparsing.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2010-06-24 11:08:54 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2010-06-24 11:08:54 +0000
commitca79012fce104827e80a3ba2d9cb5fb1d8058914 (patch)
tree12d5a3f702fa61877d98906142381cdf844f121b /pyparsing.py
parent609934cb031aab46dd1e17232aa35f5c58dd144a (diff)
downloadpyparsing_1.5.3@200.tar.gz
Add fix to originalTextFor to not include any trailing comments or ignorable textpyparsing_1.5.3@200
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/src@200 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
Diffstat (limited to 'pyparsing.py')
-rw-r--r--pyparsing.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pyparsing.py b/pyparsing.py
index cf49b36..b97c5ec 100644
--- a/pyparsing.py
+++ b/pyparsing.py
@@ -59,7 +59,7 @@ The pyparsing module handles some of the problems that are typically vexing when
"""
__version__ = "1.5.3"
-__versionTime__ = "15 Jun 2010 02:21"
+__versionTime__ = "24 Jun 2010 06:06"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -3332,8 +3332,10 @@ def originalTextFor(expr, asString=True):
the expression passed to originalTextFor contains expressions with defined
results names, you must set asString to False if you want to preserve those
results name values."""
- locMarker = Empty().setParseAction(lambda s,loc,t: loc).leaveWhitespace()
- matchExpr = locMarker("_original_start") + expr + locMarker("_original_end")
+ locMarker = Empty().setParseAction(lambda s,loc,t: loc)
+ endlocMarker = locMarker.copy()
+ endlocMarker.callPreparse = False
+ matchExpr = locMarker("_original_start") + expr + endlocMarker("_original_end")
if asString:
extractText = lambda s,l,t: s[t._original_start:t._original_end]
else: