If you're parsing a serial protocol on an embedded system where you're only getting a byte-at-a-time (from a register), or possibly up to 8 at a time, then a parser combinator library such as nom should make it very easy to create a bulletproof parser.
Definitely much easier than in C, where I've resorted to using Ragel for safely parsing serial protocols (and also in Go!) since it generates a single small dependency free source file containing the state machine and your "actions", but nom is much more expressive.