I really liked this blog post about writing fallible parsers that handle syntax errors gracefully.
I wish I'd read this before I started the KCL parser, and now I hope to someday rewrite it using this approach. Strongly suggested read for anyone curious about writing parsers. It uses the Rowan library which powers Rust Analyzer. A Rust Analyzer maintainer (rightfully) told me years ago I should have used Rowan instead of our homegrown solution. If I'd read this tutorial when we started KCL, maybe i would have!