-
Notifications
You must be signed in to change notification settings - Fork 806
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
fold range implementation #1407
Conversation
untrue.
That breaks nom convention because
Preallocation in #1402 was done because the old implementations of
When I use let res = many(0..=5,
//snip
); The user would expect the resulting Edit: many(5
//snip
); |
allow me to strongly disagree. That completely the opposite and I'm sure of it. See my comment on #1393 How do you handle
I have literally no idea how to interpret
yes I guess, doesn't concern my reason.
Since when there is such convention ? I'm sure I can find few parser that don't do that. |
https://github.com/Geal/nom/pull/1407/checks?check_run_id=3712855476
|
Part of my hope with #1393 was that This allows us to fold Personally, I think the intent is clear by having a single number be a placeholder for an inclusive range. |
I'm still not convince, I did it but I found it's very limited, can you extend what you mean with |
src/multi/fold.rs
Outdated
{ | ||
move |input: Input| match (range.start_bound(), range.end_bound()) { | ||
(Bound::Included(&min), Bound::Included(&max)) => { | ||
if min > max { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not good 2..=1
should be valid
Closes #1393.
There is main difference with #1402
many0
,many_m_n
) #1393 (comment)many
withfold
many
, I believe most of the time it's probably worst, I can't really be sure of that, but allocate a giant vector when the first item fail doesn't seem good. I think we should not p reallocate if the following could fail.I think we should have some clarification of range interpretation before continue any further.
many
functions #1409