Staging
v0.5.1
https://github.com/python/cpython
Revision 85d5c18c9d83a1d54eecc4c2ad4dce63194107c6 authored by R. David Murray on 03 December 2017, 23:51:41 UTC, committed by GitHub on 03 December 2017, 23:51:41 UTC
The original algorithm tried to delegate the folding to the tokens so
that those tokens whose folding rules differed could specify the
differences.  However, this resulted in a lot of duplicated code because
most of the rules were the same.

The new algorithm moves all folding logic into a set of functions
external to the token classes, but puts the information about which
tokens can be folded in which ways on the tokens...with the exception of
mime-parameters, which are a special case (which was not even
implemented in the old folder).

This algorithm can still probably be improved and hopefully simplified
somewhat.

Note that some of the test expectations are changed.  I believe the
changes are toward more desirable and consistent behavior: in general
when (re) folding a line the canonical version of the tokens is
generated, rather than preserving errors or extra whitespace.
1 parent 29ba688
History
Tip revision: 85d5c18c9d83a1d54eecc4c2ad4dce63194107c6 authored by R. David Murray on 03 December 2017, 23:51:41 UTC
bpo-27240 Rewrite the email header folding algorithm. (#3488)
Tip revision: 85d5c18
File Mode Size
.github
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
.gitattributes -rw-r--r-- 733 bytes
.gitignore -rw-r--r-- 1.4 KB
.hgeol -rw-r--r-- 1.0 KB
.hgignore -rw-r--r-- 1.3 KB
.hgtags -rw-r--r-- 8.7 KB
.travis.yml -rw-r--r-- 4.4 KB
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 60.2 KB
README.rst -rw-r--r-- 9.1 KB
aclocal.m4 -rw-r--r-- 10.7 KB
config.guess -rwxr-xr-x 43.2 KB
config.sub -rwxr-xr-x 35.7 KB
configure -rwxr-xr-x 472.1 KB
configure.ac -rw-r--r-- 157.0 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 41.1 KB
setup.py -rw-r--r-- 98.6 KB

README.rst

back to top