Crates.io | oni-comb-parser-rs |
lib.rs | oni-comb-parser-rs |
version | |
source | src |
created_at | 2021-11-13 01:07:37.849451 |
updated_at | 2024-12-13 00:28:16.745739 |
description | A Rust crate for parser combinators |
homepage | |
repository | https://github.com/j5ik2o/oni-comb-rs |
max_upload_size | |
id | 481233 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A Rust crate for LL(k) parser combinators.
Add this to your Cargo.toml
:
[dependencies]
oni-comb-parser-rs = "<<version>>"
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
}