To be honest, my experience with nom so far has been a fair bit offputting. And not just due to its nonexistent support for trailing commas! (though that is a big part of it!) Basically it has all the hallmarks of a big project with not enough maintainers—which is surprising considering that it has over 150 contributors on github.

Its documentation is sparse, vague, and oftentimes in the wrong place (it seems to me that module shouldn’t even be public!). Edge cases are seldom mentioned if ever.

Many of its parsers are very strangely named:

What’s the parser that, given a &str alphabet, consumes 0 or more characters from the input until it reaches one that is not in the alphabet? Answer: is_a.

There is a parser called eat_separator. It has basically no documentation, but as far as I can tell it is identical to is_a (but with a poorer implementation that sometimes fails type inference).

digit and alpha also read 0 or more characters. If you want to read one character… I’m not even sure how you do that! Some combination of take_s! and verify! maybe?

Speaking of verify!, I just now figured that I could maybe use it to simplify my function above. Unfortunately, the closure takes the argument by value, so it doesn’t work on non-Copy types.

(it also fails to infer the closure’s argument type, for which I may submit a simple PR)