This repo is created as a learning resource for the Nom crate for Rust. Nom is a parser combinators library. It can be used to parse just about anything, text, binary, whatever.
Right now, there isn't much to this project, but it will grow over time. I've spent the last week deep diving into this crate, mostly due to the desire to solve Day 6 of the Shuttle Christmas Code Hunt challenge (now called Shuttlings)
Coming Soon...
I understand how to compose the simple building block parsers.
I'm beginning to understand combinators. There is now a /count
endpoint which accepts a plain text string of any length. The endpoint responds with the word count. Nom is leveraged here via calling a parser which returns the text input as a vector of words. The .len()
method is then called to get the word count.
I feel I've "reached the end of the internet" on what folks have written about regarding this crate. There just isn't that much out there. You have to be careful because much of the content is outdated. Better articles are:
- Parsing Text with Nom
- Parsing Data in Rust with Nom
- Planespotting with Rust: Using Nom to Parse ADS-B Messages
- Creating a Bencode Parser with Nom
It's worth knowing how to do this. I'm all hot to trot about Nom, but I think a good chunk of the issues I'm having stem from not knowing the basics.