summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2008-09-05 15:11:32 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2008-09-05 15:11:32 +0000
commit2b0887193fc9d87431b7d1630fc5323c040d5f32 (patch)
tree93fb78ec4a3203424a164ba788087c75bb02746c
parent78ac6943d74059bdbd6466878167015a537697b5 (diff)
downloadpyparsing-2b0887193fc9d87431b7d1630fc5323c040d5f32.tar.gz
Fixed bug in LineStart and LineEnd which did not recognize whitespace chars set using setDefaultWhitespaceChars.
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/src@164 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
-rw-r--r--CHANGES5
-rw-r--r--pyparsing.py4
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index d0066ce..67f3aac 100644
--- a/CHANGES
+++ b/CHANGES
@@ -57,6 +57,11 @@ Version 1.5.1 - September, 2008
- Fixed bug in parseString(parseAll=True), when the input string
ends with a comment or whitespace.
+- Fixed bug in LineStart and LineEnd that did not recognize any
+ special whitespace chars defined using ParserElement.setDefault-
+ WhitespaceChars, found while debugging an issue for Marek Kubica,
+ thanks for the new test case, Marek!
+
- Made Forward class more tolerant of subclassing.
diff --git a/pyparsing.py b/pyparsing.py
index 56e9439..849d6e0 100644
--- a/pyparsing.py
+++ b/pyparsing.py
@@ -2050,7 +2050,7 @@ class LineStart(_PositionToken):
"""Matches if current position is at the beginning of a line within the parse string"""
def __init__( self ):
super(LineStart,self).__init__()
- self.setWhitespaceChars( " \t" )
+ self.setWhitespaceChars( ParserElement.DEFAULT_WHITE_CHARS.replace("\n","") )
self.errmsg = "Expected start of line"
#self.myException.msg = self.errmsg
@@ -2075,7 +2075,7 @@ class LineEnd(_PositionToken):
"""Matches if current position is at the end of a line within the parse string"""
def __init__( self ):
super(LineEnd,self).__init__()
- self.setWhitespaceChars( " \t" )
+ self.setWhitespaceChars( ParserElement.DEFAULT_WHITE_CHARS.replace("\n","") )
self.errmsg = "Expected end of line"
#self.myException.msg = self.errmsg