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 always written dumb lisp parsers in the past: a list is just "(" EXPR* ")". Checking came later.
I'm trying something different in my current project, pushing special forms into the parsing logic.
This means that e.g. (if) is a parse error. It has a different vibe.