diff options
author | ptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b> | 2008-09-05 15:11:32 +0000 |
---|---|---|
committer | ptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b> | 2008-09-05 15:11:32 +0000 |
commit | 2b0887193fc9d87431b7d1630fc5323c040d5f32 (patch) | |
tree | 93fb78ec4a3203424a164ba788087c75bb02746c | |
parent | 78ac6943d74059bdbd6466878167015a537697b5 (diff) | |
download | pyparsing-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-- | CHANGES | 5 | ||||
-rw-r--r-- | pyparsing.py | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -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
|