yap
Yet Another Parser library. A lightweight, dependency free, parser combinator inspired set of utility methods to help with parsing strings and slices.
0.12.0
5.7M downloads/mo
#4246 most downloaded on crates.io
jsdw/yap
What this package is like to depend on
Last release 3 years ago
no release in 18 months
Ships fairly regularly
a new release about every 4 months
Some releases are documented
notes for 8 of 19 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
19 releases · first in 2021
0 releases in the last 12 months
see the full history below
Release timeline
19 releases · Nov 2021 to Nov 2023Releases
latest 19-
0.12.018 Nov 2023Release notes
Open source →From #13:
- Add
Tokens::parsemethod, which attempt to parse the remaining tokens into some type viaFromStr(andstr::parse). This requires a buffer type (oftenString) to be provided as the second generic arg, and may use this to buffer tokens prior to parsing if necessary. - Add some helper functions which allow
Tokens::parseto be optimised in cases likeStrToken, so that eg callingtoks.slice(from, to).parse::<u16,String>forStrTokensand similar won't allocate. - Add
Tokens::takefor takingntokens (can be useful in conjunction withparse, above). - Add
Tokens::eof,Tokens::collectandTokens::consumefor finding an EOF (None), collecting tokens and consuming all tokens. - Add
Tokens::into_iter, for when you need to work around lifetime issues withTokens::as_iter. - Rename
Tokens::tokens_whiletoTokens::take_while, andTokens::skip_tokens_whiletoTokens::skip_while; we no longer have to worry about conflicts withIteratormethods. Tokens::{surrounded, optional, optional_err}now accept anFnOnceinstead of anFnMut, allowing a little more flexibility in what is given.- Anything which returned something implementing
Iteratornow returns something implementingTokensinstead (you can still call.as_iter()to then get a standardIteratorfrom this).
A shoutout to @EasyOakland for their contributions in this!
From #13:
- Add
yap::charsmodule which contains some helper functions (likeparse_f64) specific toimpl Tokens<Item=char>. - Generalise
yap::one_of!andTokens::optional; the output from expressions passed to either of these can now beOption<T>orbool, or more specifically anything implementingyap::one_of::IsMatch.
- Add
-
0.11.014 Jul 2023Release notes
Open source →Thankyou @Easyoakland for both of these contributions!
- Add support for
no_stdenvironments (#7). - Add
yap::types::IterToken, which can be used for parsing tokens from arbitrary iterators (as long as they impl Clone).
- Add support for
-
0.10.008 Mar 2023 -
0.9.106 Mar 2023 -
0.9.006 Mar 2023Release notes
Open source →- Remove the
Iteratorsupertrait requirement fromTokens, and instead require implementing those methods directly onTokens. Add aTokens::as_iter()method to return an Iterator from our Tokens. This is done to keep the Iterator interface and methods in a separate namespace from the Tokens ones.
- Remove the
-
0.8.109 Dec 2022Release notes
Open source →- Fix a bug whereby
.tokens("foo")will return true if we run out of input before completing the match.
- Fix a bug whereby
-
0.8.002 Jul 2022Release notes
Open source →- Add
optional_errparser, which is likeoptionalbut allows any error to be propagated.
- Add
-
0.7.226 May 2022Release notes
Open source →- Fix clippy warnings on
one_ofmacro invocations. - Run clippy on the codebase and add it to the CI.
- Fix clippy warnings on
-
0.7.127 Nov 2021Nothing published for this version
-
0.7.027 Nov 2021Nothing published for this version
-
0.6.227 Nov 2021Nothing published for this version
-
0.6.127 Nov 2021Nothing published for this version
-
0.6.021 Nov 2021Nothing published for this version
-
0.5.020 Nov 2021Nothing published for this version
-
0.4.013 Nov 2021Nothing published for this version
-
0.3.113 Nov 2021Nothing published for this version
-
0.3.013 Nov 2021Nothing published for this version
-
0.2.007 Nov 2021Nothing published for this version
-
0.1.006 Nov 2021Nothing published for this version