]> granicus.if.org Git - python/commit
Bug fixes large and small for tokenize.
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 23 Aug 2006 21:14:03 +0000 (21:14 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 23 Aug 2006 21:14:03 +0000 (21:14 +0000)
commit76467ba6d6cac910523373efe967339f96b10c85
tree09fcfeff97fea0d4d4a7080ff4c0cfd6c0e48362
parent20362a820bd09617a33721191aa966416b03427c
Bug fixes large and small for tokenize.

Small: Always generate a NL or NEWLINE token following
       a COMMENT token.  The old code did not generate an NL token if
       the comment was on a line by itself.

Large: The output of untokenize() will now match the
       input exactly if it is passed the full token sequence.  The
       old, crufty output is still generated if a limited input
       sequence is provided, where limited means that it does not
       include position information for tokens.

Remaining bug: There is no CONTINUATION token (\) so there is no way
for untokenize() to handle such code.

Also, expanded the number of doctests in hopes of eventually removing
the old-style tests that compare against a golden file.

Bug fix candidate for Python 2.5.1. (Sigh.)
Lib/test/output/test_tokenize
Lib/test/test_tokenize.py
Lib/tokenize.py