Closed GoogleCodeExporter closed 8 years ago
thanks paul, yes this is a bug. I will have a look.
Original comment by mark.duf...@gmail.com
on 30 Jan 2013 at 2:37
Original comment by mark.duf...@gmail.com
on 30 Jan 2013 at 2:45
I changed this regex from:
re.compile(r"#{.*?#}", re.MULTILINE | re.DOTALL)
to this:
re.compile(r"#{.*?#}[^\r\n]*$", re.MULTILINE | re.DOTALL)
The difference being that this also matches everything that comes after #} up
to the next newline. Notice that in this case I can't use the dot character
since that one will consume the newline (re.DOTALL). If I use the dot
character, everything after #} gets commented.
As far as I can tell, this will also work in Windows. It's been a while since I
used regular expressions (I used to be a big fan, used to...
http://www.xkcd.com/1171/, now I use things like pyparsing)
Anyway, let me know how it goes.
Original comment by ernestof...@gmail.com
on 21 Mar 2013 at 2:18
Attachments:
thanks a lot ernesto! I pushed the patch, and added a test to tests/201.py.
yeah, perhaps it would be nicer to replace the regular expression obfuscation
with a simple loop over the lines in the source code.. but this should work
fine, too.
Original comment by mark.duf...@gmail.com
on 21 Mar 2013 at 8:21
Excellent. I'm glad it worked!
Original comment by ernestof...@gmail.com
on 22 Mar 2013 at 2:41
Original issue reported on code.google.com by
paulhaeb...@gmail.com
on 30 Jan 2013 at 6:54Attachments: