whitespace , comment stripper, and EOL converter
M.E.Farmer
mefjr75 at hotmail.com
Sun Apr 17 15:47:15 EDT 2005
I found the bug and hope I have squashed it.
Single and qouble quoted strings that were assignments and spanned
multilines using \ , were chopped after the first line.
example:
__date__ = 'Apr 16, 2005,' \
'Jan 15 2005,' \
'Oct 24 2004'
became:
__date__ = 'Apr 16, 2005,' \
Not good :(
tokenizer sends this as:
name
operator
string
string
string
newline
I added test for string assignments that end in \.
A flag is set and then all strings till a newline are ignored.
Also rearranged the script a little.
Maybe that will do it ...
Updates available at
> The script is located at:
> http://bellsouthpwp.net/m/e/mefjr75/python/stripper.py
>
> M.E.Farmer
More information about the Python-list
mailing list