Staging
v0.5.1
Revision 97f43c019f3bb8376a3a5f7bc52e97b4c2ed8e16 authored by R David Murray on 24 June 2012, 09:03:27 UTC, committed by R David Murray on 24 June 2012, 09:03:27 UTC
This code passes all the same tests that the existing RFC mime header
parser passes, plus a bunch of additional ones.

There are a couple of commented out tests where there are issues with the
folding.  The folding doesn't normally get invoked for headers parsed from
source, and the cases are marginal anyway (headers with invalid binary data)
so I'm not worried about them, but will fix them after the beta.

There are things that can be done to make this API even more convenient, but I
think this is a solid foundation worth having.  And the parser is a full RFC
parser, so it handles cases that the current parser doesn't.  (There are also
probably cases where it fails when the current parser doesn't, but I haven't
found them yet ;)

Oh, yeah, and there are some really ugly bits in the parser for handling some
'postel' cases that are unfortunately common.

I hope/plan to to eventually refactor a lot of the code in the parser which
should reduce the line count...but there is no escaping the fact that the
error recovery is welter of special cases.
1 parent 49c15d4
History
File Mode Size
Python-ast.h -rw-r--r-- 21.5 KB
Python.h -rw-r--r-- 2.8 KB
abstract.h -rw-r--r-- 41.6 KB
accu.h -rw-r--r-- 1016 bytes
asdl.h -rw-r--r-- 1.1 KB
ast.h -rw-r--r-- 344 bytes
bitset.h -rw-r--r-- 792 bytes
bltinmodule.h -rw-r--r-- 264 bytes
boolobject.h -rw-r--r-- 886 bytes
bytearrayobject.h -rw-r--r-- 2.0 KB
bytes_methods.h -rw-r--r-- 2.0 KB
bytesobject.h -rw-r--r-- 4.8 KB
cellobject.h -rw-r--r-- 701 bytes
ceval.h -rw-r--r-- 7.0 KB
classobject.h -rw-r--r-- 1.6 KB
code.h -rw-r--r-- 4.1 KB
codecs.h -rw-r--r-- 5.2 KB
compile.h -rw-r--r-- 1.6 KB
complexobject.h -rw-r--r-- 1.9 KB
datetime.h -rw-r--r-- 8.3 KB
descrobject.h -rw-r--r-- 2.8 KB
dictobject.h -rw-r--r-- 4.9 KB
dtoa.h -rw-r--r-- 458 bytes
dynamic_annotations.h -rw-r--r-- 21.9 KB
enumobject.h -rw-r--r-- 253 bytes
errcode.h -rw-r--r-- 1.5 KB
eval.h -rw-r--r-- 597 bytes
fileobject.h -rw-r--r-- 1.7 KB
fileutils.h -rw-r--r-- 1.1 KB
floatobject.h -rw-r--r-- 4.5 KB
frameobject.h -rw-r--r-- 3.3 KB
funcobject.h -rw-r--r-- 3.7 KB
genobject.h -rw-r--r-- 1.1 KB
graminit.h -rw-r--r-- 1.8 KB
grammar.h -rw-r--r-- 2.0 KB
import.h -rw-r--r-- 3.8 KB
intrcheck.h -rw-r--r-- 460 bytes
iterobject.h -rw-r--r-- 567 bytes
listobject.h -rw-r--r-- 2.8 KB
longintrepr.h -rw-r--r-- 3.9 KB
longobject.h -rw-r--r-- 7.1 KB
marshal.h -rw-r--r-- 743 bytes
memoryobject.h -rw-r--r-- 2.8 KB
metagrammar.h -rw-r--r-- 253 bytes
methodobject.h -rw-r--r-- 3.2 KB
modsupport.h -rw-r--r-- 4.8 KB
moduleobject.h -rw-r--r-- 1.5 KB
namespaceobject.h -rw-r--r-- 297 bytes
node.h -rw-r--r-- 930 bytes
object.h -rw-r--r-- 36.5 KB
objimpl.h -rw-r--r-- 13.2 KB
opcode.h -rw-r--r-- 5.1 KB
osdefs.h -rw-r--r-- 869 bytes
parsetok.h -rw-r--r-- 2.2 KB
patchlevel.h -rw-r--r-- 1.1 KB
pgen.h -rw-r--r-- 253 bytes
pgenheaders.h -rw-r--r-- 1.1 KB
py_curses.h -rw-r--r-- 4.1 KB
pyarena.h -rw-r--r-- 2.7 KB
pyatomic.h -rw-r--r-- 5.8 KB
pycapsule.h -rw-r--r-- 1.7 KB
pyctype.h -rw-r--r-- 1.3 KB
pydebug.h -rw-r--r-- 986 bytes
pyerrors.h -rw-r--r-- 14.3 KB
pyexpat.h -rw-r--r-- 2.1 KB
pyfpe.h -rw-r--r-- 8.3 KB
pygetopt.h -rw-r--r-- 388 bytes
pymacconfig.h -rw-r--r-- 2.9 KB
pymacro.h -rw-r--r-- 1.7 KB
pymath.h -rw-r--r-- 6.3 KB
pymem.h -rw-r--r-- 4.6 KB
pyport.h -rw-r--r-- 30.3 KB
pystate.h -rw-r--r-- 7.5 KB
pystrcmp.h -rw-r--r-- 436 bytes
pystrtod.h -rw-r--r-- 1.2 KB
pythonrun.h -rw-r--r-- 8.8 KB
pythread.h -rw-r--r-- 3.0 KB
pytime.h -rw-r--r-- 2.6 KB
rangeobject.h -rw-r--r-- 629 bytes
setobject.h -rw-r--r-- 3.2 KB
sliceobject.h -rw-r--r-- 1.3 KB
structmember.h -rw-r--r-- 2.0 KB
structseq.h -rw-r--r-- 1.2 KB
symtable.h -rw-r--r-- 4.5 KB
sysmodule.h -rw-r--r-- 1.2 KB
token.h -rw-r--r-- 1.8 KB
traceback.h -rw-r--r-- 2.1 KB
tupleobject.h -rw-r--r-- 2.4 KB
typeslots.h -rw-r--r-- 2.0 KB
ucnhash.h -rw-r--r-- 1.0 KB
unicodeobject.h -rw-r--r-- 74.5 KB
warnings.h -rw-r--r-- 953 bytes
weakrefobject.h -rw-r--r-- 2.4 KB

back to top