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

Documentation or examples for Range and Set #58

Open
mcclure opened this issue Dec 27, 2022 · 1 comment
Open

Documentation or examples for Range and Set #58

mcclure opened this issue Dec 27, 2022 · 1 comment

Comments

@mcclure
Copy link
Contributor

mcclure commented Dec 27, 2022

I don't quite understand what Range and Set are for. It would be good if they had documentation strings, or at least an example. I could help write documentation as a PR if I had an example to compare to or an explanation.

If "Range" is something used internally by the library and not intended to be messed with directly by users, the documentation strings should say that.

I would very much like to be able to match a range of values, like (('a' as u8)..=('z' as u8)). Is that what Range does?

@nigeleke
Copy link
Contributor

nigeleke commented Mar 3, 2024

You've probably found an answer to this already; I'm not the OA but both Range and Set appear helper classes for one_of(aSet) or repeat(range). A recent PR I requested makes these pub(crate).

WRT the match of range of values - this is (almost) possible with one_of(&(b'A'..b'Z')). Note: that example is not an inclusive range however a recent PR I requested enables inclusive ranges one_of(&(b'A'..=b'Z'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants