-
Notifications
You must be signed in to change notification settings - Fork 24
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 CharRange type #91
Comments
Filed #93 as a follow up to this, for |
I found (Also, both crates are two years old, but then again character iteration isn't going to change.) In conclusion, adding a Because a character range is such a self-contained interest (and I'm currently working on a project that would also enjoy having one), I'm considering making it its own crate. What do you think @behnam? |
Thanks for the research, @CAD97. Very helpful. Yeah, now thinking about it again, looks like things like That said, I like the idea of keeping all these things under one repository, because it allows faster development and one-step reviews, instead of going back and forth between repos. The main problem in this area is the fact that we don't have CI/devops tools to test cross-repo PRs before merging. Hopefully this will change in a near future, but for now, it's too much cost to maintain small repos. This is why there are many multi-package repositories (like https://github.com/BurntSushi/ripgrep/), which host many small packages internally, so they can be developed with all the cross-package tests. I think eventually we can split out these kinds of packages into their own repo. But for the current stage, which is fast development and not maintaining a stable API yet, I think we better keep them all in. About organization in UNIC, we can actually put these components under What do you think? |
That seems like a good path forward to me! |
I think we can generally improve Some ideas for now... We want Both will be implementing Also, What do you think? |
I'm just putting some polish onto it right now and then I'll send the PR. |
Right, right, not traits to implement, but types to stay similar to. How about |
I've just done an inclusive range. The reasoning is that that's how character ranges are traditionally described, such as the regex set If we really want an exclusive range it can be an alternate constructor. |
Well, I don't really care much about the exclusive range, but I want us to stay as close to rustc as possible in semantics of the names. If we only have an inclusive range, I say we should call it For easy of use of the shorter syntax, we can have a What do you think? |
I've submitted the PR so you can see the code; it checks out but I'm currently expanding docs and writing tests. I wouldn't be unhappy actually making |
Now that we want to be fancy, we can even support the
😄 |
I'm pretty sure that if we want to do that, we'll need a procedural macro. There's no way within |
Yeah, that was mostly a joke. But, if we ever end up writing a procedural macro for building transformation pipelines, we can consider supporting the |
112: [char/range] Add CharRange and CharIter r=behnam The first half of adressing #91. Closes #111, this manner of attack is better than it. This PR only has one type, `CharRange`. It is effectively `std::ops::RangeInclusive` translated to characters. The matter of construction is handled by both half-open and closed constructors offered and a macro to allow for `'a'..='z'` syntax.
Closed by #112 |
[assign: @CAD97]
Replace usages of
(char, char)
as an inclusive range with a custom Range struct adapted for use on characters.The text was updated successfully, but these errors were encountered: