tinyparse

Crates.iotinyparse
lib.rstinyparse
version0.2.3
sourcesrc
created_at2022-05-01 08:45:54.220839
updated_at2022-05-01 14:13:24.056976
descriptionA tiny combinator parser library.
homepage
repositoryhttps://github.com/Bitbot25/tinyparse
max_upload_size
id578534
size17,513
verified (Bitbot25)

documentation

https://docs.rs/tinyparse/0.2.3/tinyparse/

README

Tinyparse

A tiny library for parsing simple expressions.

Quickstart

use tinyparse::common;
use tinyparse::{Span, Parse};

let hello_or_int = common::literal("hello!").or(common::int());
// The parse functions return a result containing what's left of "10" and the actual result.
assert_eq!(hello_or_int.parse(Span::new("10")), Ok((Span::empty(), 10)));

Limitations

Some expressions need lookahead capability or something similar to be parsed. Unfortunately; this library does not include this.
If you want lookahead capability, consider implementing your own parser using the Parse trait.

Note: This library is a work in progress. New things are getting added and breaking changes may occur.

Commit count: 14

cargo fmt