]> git.notmuchmail.org Git - notmuch/commit
emacs: Streaming S-expression parser
authorAustin Clements <amdragon@MIT.EDU>
Sat, 1 Jun 2013 00:40:06 +0000 (20:40 -0400)
committerDavid Bremner <bremner@debian.org>
Sat, 1 Jun 2013 11:56:25 +0000 (08:56 -0300)
commitb89ffba3012603d3eb9b1e144bf0a81480588ea3
treeb0ede72e9ee4f5bd729bb657a14349c47dad3439
parent08fde50bf3a4c54f6413aff4052e0d84392463f9
emacs: Streaming S-expression parser

This provides the same interface as the streaming JSON parser, but
reads S-expressions incrementally.  The only difference is that the
`notmuch-sexp-parse-partial-list' helper does not handle interleaved
error messages (since we now have the ability to separate these out at
the invocation level), so it no longer takes an error function and
does not need to do the horrible resynchronization that the JSON
parser had to.

Some implementation improvements have been made over the JSON parser.
This uses a vector instead of a list for the parser data structure,
since this allows faster access to elements (and modern versions of
Emacs handle storage of small vectors efficiently).  Private functions
follow the "prefix--name" convention.  And the implementation is much
simpler overall because S-expressions are much easier to parse.
emacs/Makefile.local
emacs/notmuch-parser.el [new file with mode: 0644]