Crates.io | parcours |
lib.rs | parcours |
version | 0.3.0 |
source | src |
created_at | 2023-12-20 16:28:35.774246 |
updated_at | 2024-03-11 10:42:09.234161 |
description | Parser Combinators for Unique Results |
homepage | |
repository | https://github.com/01mf02/parcours |
max_upload_size | |
id | 1075453 |
size | 76,396 |
parcours is a minimalistic crate to help with the creation of parsers and lexers. It provides a set of parser combinators for parsers that return unique results; that is, at most one output.
The name "parcours" is inspired from the sport Parkour, in which practitioners attempt to "get from point A to point B in the fastest and most efficient way possible, without assisting equipment".
In the same sense, parcours provides only very basic building blocks for parsers, but these building blocks are very generic and incur very small overhead, so you can do nearly everything with them.
no_std
and no dependency on alloc
→ suitable for constrained (embedded) environments--release
&str
and &[T]
are provided)I discovered the lip crate only once I was already on a good way into writing parcours. It is spiritually the closest to parcours in the Rust ecosystem that I found so far. Apart from it, there are many parser combinator crates. I have personally implemented quite complex parsers using nom and chumsky, which both provide nice machinery for common use cases, but I always struggled once I wanted to do something that was not intended by these crates. In contrast, parcours provides much less machinery, and it is my hope that this makes it also more flexible.