PackageTrack
Sign in Get early access

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 2023
2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 19
  1. 0.12.0 18 Nov 2023
    Release notes

    From #13:

    • 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 String) 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::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.
    • Add Tokens::take for taking n tokens (can be useful in conjunction with parse, above).
    • Add Tokens::eof, Tokens::collect and Tokens::consume for finding an EOF (None), collecting tokens and consuming all tokens.
    • Add Tokens::into_iter, for when you need to work around lifetime issues with Tokens::as_iter.
    • Rename 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.
    • Anything which returned something implementing 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:

    • Add yap::chars module which contains some helper functions (like parse_f64) specific to impl Tokens<Item=char>.
    • Generalise 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.
    Open source →
  2. 0.11.0 14 Jul 2023
    Release notes

    Thankyou @Easyoakland for both of these contributions!

    • Add support for no_std environments (#7).
    • Add yap::types::IterToken, which can be used for parsing tokens from arbitrary iterators (as long as they impl Clone).
    Open source →
  3. 0.10.0 08 Mar 2023
    Release notes
    • Remove pointless skip_optional function.
    Open source →
  4. 0.9.1 06 Mar 2023
    Release notes
    • Tidy up some docs and deny missing docs on public items.
    Open source →
  5. 0.9.0 06 Mar 2023
    Release notes
    • Remove the 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.
    Open source →
  6. 0.8.1 09 Dec 2022
    Release notes
    • Fix a bug whereby .tokens("foo") will return true if we run out of input before completing the match.
    Open source →
  7. 0.8.0 02 Jul 2022
    Release notes
    • Add optional_err parser, which is like optional but allows any error to be propagated.
    Open source →
  8. 0.7.2 26 May 2022
    Release notes
    • Fix clippy warnings on one_of macro invocations.
    • Run clippy on the codebase and add it to the CI.
    Open source →
  9. 0.7.1 27 Nov 2021

    Nothing published for this version

  10. 0.7.0 27 Nov 2021

    Nothing published for this version

  11. 0.6.2 27 Nov 2021

    Nothing published for this version

  12. 0.6.1 27 Nov 2021

    Nothing published for this version

  13. 0.6.0 21 Nov 2021

    Nothing published for this version

  14. 0.5.0 20 Nov 2021

    Nothing published for this version

  15. 0.4.0 13 Nov 2021

    Nothing published for this version

  16. 0.3.1 13 Nov 2021

    Nothing published for this version

  17. 0.3.0 13 Nov 2021

    Nothing published for this version

  18. 0.2.0 07 Nov 2021

    Nothing published for this version

  19. 0.1.0 06 Nov 2021

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive