#parser-combinator #parsec #parser

no-std bin+lib anpa

A generic monadic parser combinator library inspired by Haskell's parsec

8 breaking releases

0.10.0 Jul 5, 2025
0.9.0 Feb 13, 2025
0.8.0 Feb 13, 2025
0.7.0 Nov 11, 2024
0.4.1 Mar 12, 2024

#2 in #parsec

Download history 103/week @ 2025-10-05 244/week @ 2025-10-12 303/week @ 2025-10-19 307/week @ 2025-10-26 290/week @ 2025-11-02 250/week @ 2025-11-09 265/week @ 2025-11-16 234/week @ 2025-11-23 308/week @ 2025-11-30 510/week @ 2025-12-07 204/week @ 2025-12-14 235/week @ 2025-12-21 335/week @ 2025-12-28 232/week @ 2026-01-04 253/week @ 2026-01-11 457/week @ 2026-01-18

1,308 downloads per month
Used in tachyonfx

MIT/Apache

120KB
2K SLoC

anpa

A generic monadic parser combinator library based on anpa which in turn is inspired by Haskell's parsec.

Features

All parsers and combinators, with the exceptions below, are allocation free and can be used with no_std when disabling the default features of this crate.

Allocating parsers:

  • many_to_vec, many_to_map_ordered: Require feature "alloc"
  • many_to_map: Requires feature "std"

Examples

See the provided test parsers

  • JSON parser: JSON DOM parser. It's only ~30 LOC and gives a good overview on how to use the library, including recursive parsers.
  • SemVer Parser: a parser for the SemVer format

These parsers can be enabled using the features "json" and "semver" respectively.

Dependencies

None

TODO

  • Add support for Read
  • More extensive test cases

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps

Features