Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement nom traits for slices other than byte slices #1482

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Dec 24, 2021

  1. Split Compare trait into Compare and CompareIgnoreCase

    For some input streams, it doesn't make sense to ignore case when comparing.
    Make `CompareIgnoreCase` a separate trait to avoid having to implement it anyway.
    jyn514 committed Dec 24, 2021
    Configuration menu
    Copy the full SHA
    598a4c0 View commit details
    Browse the repository at this point in the history
  2. Implement nom traits for more slices, not just byte slices

    This can be useful in cases where you already have an in-memory flat representation,
    but want to use Nom to traverse it in a custom order.
    
    This has a few opinionated decisions:
    - `InputIter` is only implemented when `T: Copy`. This could easily be relaxed to `T: Clone`,
      but that could be surprising if T is expensive to clone.
    - `Compare` is only implemented when `T: Eq`. This could be relaxed to PartialEq.
    jyn514 committed Dec 24, 2021
    Configuration menu
    Copy the full SHA
    0d751a2 View commit details
    Browse the repository at this point in the history