From 53d55c3ed2cfe70bf844a4604698b3cb9808b03c Mon Sep 17 00:00:00 2001 From: ptmcg Date: Thu, 6 Oct 2016 06:14:20 +0000 Subject: Fixed bug in col, which allowed simplification of LineStart down to minimal implementation git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@447 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b --- src/CHANGES | 4 +++- src/pyparsing.py | 12 +++--------- src/unitTests.py | 40 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/CHANGES b/src/CHANGES index bf964aa..8bf25f2 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -10,7 +10,9 @@ Version 2.1.10 - - Fixed behavior of LineStart to be much more predictable. LineStart can now be used to detect if the next parse position is col 1, factoring in potential leading whitespace (which would - cause LineStart to fail). + cause LineStart to fail). Also fixed a bug in col, which is + used in LineStart, where '\n's were erroneously considered to + be column 1. - Added support for multiline test strings in runTests. diff --git a/src/pyparsing.py b/src/pyparsing.py index a12e1b6..c809956 100644 --- a/src/pyparsing.py +++ b/src/pyparsing.py @@ -61,7 +61,7 @@ The pyparsing module handles some of the problems that are typically vexing when """ __version__ = "2.1.10" -__versionTime__ = "04 Oct 2016 00:19 UTC" +__versionTime__ = "06 Oct 2016 06:04 UTC" __author__ = "Paul McGuire " import string @@ -953,7 +953,7 @@ def col (loc,strg): positions within the parsed string. """ s = strg - return 1 if loc