NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #4398 most downloaded on crates.io
Yet Another Parser library. A lightweight, dependency free, parser combinator inspired set of utility methods to help with parsing strings and slices.
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
One column per quarter.
Add Tokens::parse method, which attempt to parse the remaining tokens into some type via FromStr (and str::parse). This requires a buffer type (often
From #13:
Tokens::parse method, which attempt to parse the remaining tokens into some type via
FromStr (and str::parse). This requires a buffer type (often String) to be provided as
the second generic arg, and may use this to buffer tokens prior to parsing if necessary.Tokens::parse to be optimised in cases like StrToken,
so that eg calling toks.slice(from, to).parse::<u16,String> for StrTokens and similar won't
allocate.Tokens::take for taking n tokens (can be useful in conjunction with parse, above).Tokens::eof, Tokens::collect and Tokens::consume for finding an EOF (None), collecting
tokens and consuming all tokens.Tokens::into_iter, for when you need to work around lifetime issues with Tokens::as_iter.Tokens::tokens_while to Tokens::take_while, and Tokens::skip_tokens_while to
Tokens::skip_while; we no longer have to worry about conflicts with Iterator methods.Tokens::{surrounded, optional, optional_err} now accept an FnOnce instead of an FnMut,
allowing a little more flexibility in what is given.Iterator now returns something implementing
Tokens instead (you can still call .as_iter() to then get a standard Iterator from this).A shoutout to @EasyOakland for their contributions in this!
From #13:
yap::chars module which contains some helper functions (like parse_f64)
specific to impl Tokens<Item=char>.yap::one_of! and Tokens::optional; the output from expressions passed to
either of these can now be Option<T> or bool, or more specifically anything implementing
yap::one_of::IsMatch.Thankyou @Easyoakland for both of these contributions!
Thankyou @Easyoakland for both of these contributions!
no_std environments (#7).yap::types::IterToken, which can be used for parsing tokens from arbitrary
iterators (as long as they impl Clone).Remove pointless skip_optional function.
skip_optional function.Tidy up some docs and deny missing docs on public items.
Remove the Iterator supertrait requirement from Tokens, and instead require implementing those methods directly on Tokens. Add a Tokens::as_iter() met
Iterator supertrait requirement from Tokens, and instead require implementing those
methods directly on Tokens. Add a Tokens::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.Fix a bug whereby .tokens("foo") will return true if we run out of input before completing the match.
.tokens("foo") will return true if we run out of input before completing the match.Add optional_err parser, which is like optional but allows any error to be propagated.
optional_err parser, which is like optional but allows any error to be propagated.Fix clippy warnings on one_of macro invocations.
one_of macro invocations.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →