| Crates.io | bad_parsers |
| lib.rs | bad_parsers |
| version | 0.2.0-unstable |
| created_at | 2025-04-18 03:13:57.149034+00 |
| updated_at | 2025-04-23 10:29:07.687002+00 |
| description | A parser combinator library written by myself, for myself |
| homepage | |
| repository | https://github.com/HallMatthew314/bad_parsers |
| max_upload_size | |
| id | 1638779 |
| size | 214,671 |
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.
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.
Probably not. I haven't benchmarked it and I would have to be very bored to want to do that in the future.
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.
Absolutely not!
And neither should you! :D
How to use this library in 5 easy steps:
cargo add bad_parsers in your project directory, or manually add the following to your project's dependencies in Cargo.toml:[dependencies]
bad_parsers = "<latest version here>"
use bad_parsers::{Parser, string};
fn main() {
let p = string("hello");
let r = p.parse("hello world");
assert_eq!((" world", "hello"), r.unwrap());
}
Please don't.