-
Notifications
You must be signed in to change notification settings - Fork 10
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
Draft
epage
wants to merge
56
commits into
rinja-rs:master
Choose a base branch
from
epage:winnow-05
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+669
−581
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
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
I had considered making the input a `&mut &str` but didn't really see the benefit, especially at this stage. That can always be changed later.
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.