-
Notifications
You must be signed in to change notification settings - Fork 12
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
Upgrade from Winnow 0.4 to 0.5 #214
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GuillaumeGomez
changed the title
Upgrade from Winnow 0.3 to 0.4
Upgrade from Winnow 0.4 to 0.5
Oct 28, 2024
epage
force-pushed
the
winnow-05
branch
3 times, most recently
from
November 4, 2024 20:44
3247bba
to
f8ce339
Compare
epage
force-pushed
the
winnow-05
branch
4 times, most recently
from
November 7, 2024 19:48
b017d2c
to
3fd7521
Compare
epage
force-pushed
the
winnow-05
branch
2 times, most recently
from
November 11, 2024 15:28
a1ac0fa
to
e229746
Compare
epage
force-pushed
the
winnow-05
branch
4 times, most recently
from
November 25, 2024 22:24
739839b
to
36601b1
Compare
epage
force-pushed
the
winnow-05
branch
2 times, most recently
from
December 19, 2024 20:46
f54b2fa
to
a0614ce
Compare
This leaves room for a new `ParseResult` that doesn't have the input as we transition to the Winnow 0.5 API.
In 0.4, `parse_next` and `parse_peek` are the same. In 0.5, `parse_next`s signature will change. By switching to `parse_peek` now, we can make it so we gradually adopt the new `parse_next` signature.
In 0.4, `unpeek` is a no-op. In 0.5, the `FnMut` signature impled for `Parser` changes and `unpeek` will take the old signature and adapt it to work. This allows us to more gradually migrate to the new `FnMut` signature. Yes, the name `unpeek` isn't ideal but its only transitional.
Note: `tests::fuzzed_target_recursion` fails on debug builds because of the extra overhead from the deprecated APIs adapting to their non-deprecated forms
epage
force-pushed
the
winnow-05
branch
2 times, most recently
from
December 20, 2024 15:53
2a92482
to
341ce9a
Compare
GuillaumeGomez
approved these changes
Dec 20, 2024
Looks good to me, thanks a lot! |
Thank you very much for your work! This PR was huge. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The biggest change in this release is switching from
Fn(I) -> Result<(I, O, E>
toFn(&mut I) -> Result<O, E>
. This offers better ergonomics and performance. "Checkpoints" were introduced as a way to save off a specific location and return to it later, replacing the input juggling done before.To make this major shift more doable, compatibility APis were added.
parse_peek
is like the newparse_next
except it has the old signature.unpeek
turns the old signature into the new one. These are terrible names but meant to be short-lived in a code base.