#parser-combinator #combinator #parser

oni-comb-parser-rs

A Rust crate for parser combinators

788 releases (108 stable)

new 1.2.105 Nov 4, 2025
1.2.99 Sep 30, 2025
1.2.89 Jul 29, 2025
1.2.28 Mar 31, 2025
0.0.4 Nov 15, 2021

#24 in Parser tooling

Download history 164/week @ 2025-07-11 158/week @ 2025-07-18 427/week @ 2025-07-25 188/week @ 2025-08-01 282/week @ 2025-08-08 175/week @ 2025-08-15 155/week @ 2025-08-22 166/week @ 2025-08-29 151/week @ 2025-09-05 214/week @ 2025-09-12 390/week @ 2025-09-19 322/week @ 2025-09-26 378/week @ 2025-10-03 237/week @ 2025-10-10 149/week @ 2025-10-17 123/week @ 2025-10-24

912 downloads per month
Used in 8 crates (4 directly)

MIT/Apache

160KB
4K SLoC

oni-comb-parser-rs

A Rust crate for LL(k) parser combinators.

Install to Cargo.toml

Add this to your Cargo.toml:

[dependencies]
oni-comb-parser-rs = "<<version>>"

Usage

use oni_comb_parser_rs::prelude::*;

fn main() {
  let input: &[u8; 14] = b"'hello world';";

  let parser: Parser<u8, &str> = surround(
    elm(b'\''),
    (seq(b"hello") + elm_space() + seq(b"world")).collect(),
    elm(b'\'') + elm(b';'),
  )
  .map_res(std::str::from_utf8);
  let result: &str = parser.parse(input).unwrap();

  println!("{}", result); // hello world
}

Influenced by the following parsers implementations

Examples

Alternative parsers

Dependencies

~2–3MB
~54K SLoC