Thanks for this. I'm impressed. Your syntax-ppss--data is far more
elegant than my syntax-ppss-set-cache. The burden of carrying around
the caches in cons cells is much less than I had feared. The amendments
to syntax-ppss are also less than I had feared, amounting to little more
than substituting "syntax-ppss-cache" with "ppss-cache" etc., and making
a few bindings to support that.
But there's one small change I would ask you to consider making - that
is, in the cache conses, to put ppss-last in the car and ppss-cache in
the cdr. That way, while debugging, ppss-last will be easy to find
(it's the first element of the list) and ppss-cache will also be easy to
find (the second element onwards).