Crates.io | kombi |
lib.rs | kombi |
version | 0.2.2 |
source | src |
created_at | 2020-03-16 15:27:00.238301 |
updated_at | 2020-03-17 09:54:42.205072 |
description | A Parser Combinator Library |
homepage | |
repository | https://github.com/jess-sch/kombi |
max_upload_size | |
id | 219499 |
size | 15,127 |
An Iterator-based Parser Combinator Library for Rust.
Included batteries:
Parser
trait
&str
char
<T, Iter: Iterator + Clone> Fn(Iter) -> Option<(Iter, T)>
()
to ensure that there is nothing left to parseMany
for repeated occurrencesMaybe
for optionals (e.g. ' '.maybe()
to allow, but not require, a space)NaturalNumber
for whole numbers between 0 and u128::max_value()
Or
for choosing between two Parser
sThen
for chaining multiple Parser
s togetherTransform
for transforming the output of a Parser
into another value.("true".or("True"))
.or("false".or("False"))
.transform(|x|match x {
Either::A(_) => true,
Either::B(_) => false,
})
.parse_str("false!")? == ("!", false)