Jan David Mol <jjd...@gmail.com> added the comment: As there seems to be some interest, I've continued working on patching this issue.
Attached is an improved version of the patch, including additions to test_shlex.py. Improved in the sense that newlines after a comment are not considered to be actually part of the comment (according to POSIX), which makes a difference when newlines are tokens. To accomplish this, I had to add an ungetc buffer to shlex, in order to push back any newlines read by the readline() routine used when a comment is encountered. @Gabriel: the test case of no newline at the end of the file after a comment is addressed. Relevant POSIX sections are Shell & Utilities 2.3(10) Rationale C.2.3 ---------- Added file: http://bugs.python.org/file15708/lexer-newline-tokens-patch-2.0.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7089> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com