2 unstable releases
Uses new Rust 2024
new 0.2.0-unstable | Apr 23, 2025 |
---|---|
0.1.0-unstable | Apr 18, 2025 |
#46 in Parser tooling
233 downloads per month
145KB
2K
SLoC
bad_parsers
WARNING: CURRENTLY NOT STABLE
This library's API is far from finalized, and different components can change or vanish without warning.
It is not currently recommended to use this library for any vaguely-serious projects.
What is this thing?
bad_parsers
is the parsing library I end up re-implementing every few months, so I figured I might as well make it an actual crate.
This library uses parser combinators to create complex parsers that can parse from strings and slices of arbitrary token types.
This is the only parsing method I know anything about approach I use the most when trying to parse and/or lex things in various projects.
More information about this project can be found in the documentation.
Is it Blazingly Fast 🚀?
Probably not. I haven't benchmarked it and I would have to be very bored to want to do that in the future.
Is it Safe™?
As of writing, the only unsafe
things in the library are the Send
and Sync
implementations for the ParseError
type.
I have attempted to prove their thread-safety in some comments near the implementation and it seems fine to me.
Are you ever going to take this project seriously?
Absolutely not!
And neither should you! :D
Using this library
How to use this library in 5 easy steps:
- Don't.
- Run
cargo add bad_parsers
in your project directory, or manually add the following to your project's dependencies inCargo.toml
:
[dependencies]
bad_parsers = "<latest version here>"
- Start using it:
use bad_parsers::{Parser, string};
fn main() {
let p = string("hello");
let r = p.parse("hello world");
assert_eq!((" world", "hello"), r.unwrap());
}
- Realize your mistake.
- Switch to nom.
Contributing
Please don't.