Microsoft is writing a PHP parser that handles error recovery well, and the internals docs are really accessible.
It includes a discussion of handling trivia and even some sample parsing code.
I've released difftastic 0.59! In this release:
* Fixed a nasty crash on textual files
* Added F# and device tree support
* Improved comment syntax highlighting (especially for Elm)