Add a lowered representation for markers#9341
Merged
charliermarsh merged 1 commit intocharlie/evalfrom Nov 25, 2024
Merged
Conversation
c00c975 to
d3a9b27
Compare
Member
Author
|
This does mean that we'll "drop" invalid extras, like |
charliermarsh
commented
Nov 22, 2024
| .name() | ||
| .as_extra() | ||
| .is_some_and(|extra| extras.contains(extra)), | ||
| ) |
Member
Author
There was a problem hiding this comment.
Just an example of the simplification that we get in return. This specific case is obviously not a big win, but changing the representation (such that we have an internal representation that's separate from the exact grammar and how they're parsed) is the crucial piece.
55a569d to
5eca3e9
Compare
d3a9b27 to
6d6b863
Compare
ibraheemdev
approved these changes
Nov 24, 2024
charliermarsh
added a commit
that referenced
this pull request
Nov 25, 2024
## Summary This PR introduces a set of parallel structs to `MarkerValueString`, `MarkerValueExtra`, and `MarkerValueVersion` that remove various pieces of information and representations that shouldn't be available in the marker algebra. To start, I've _just_ removed the invalid extra component from `MarkerValueExtra` -- there are no other changes to the representation. So, throughout the marker algebra, we can't represent and thus don't have to worry about clauses with invalid extras. The subsequent changes I plan to make are: 1. Removing `python_version`, since we exclusively use `python_version_full` in the algebra. 2. Removing the deprecated aliases, such that we re-map to the correct marker value. 3. Consolidating `sys_platform` and `platform_release` (the original motivation).
konstin
reviewed
Nov 26, 2024
Member
konstin
left a comment
There was a problem hiding this comment.
nit: Maybe ParsedMarker<...> vs CanonicalMarlker<...>?
Code looks good
charliermarsh
added a commit
that referenced
this pull request
Nov 26, 2024
## Summary This PR introduces a set of parallel structs to `MarkerValueString`, `MarkerValueExtra`, and `MarkerValueVersion` that remove various pieces of information and representations that shouldn't be available in the marker algebra. To start, I've _just_ removed the invalid extra component from `MarkerValueExtra` -- there are no other changes to the representation. So, throughout the marker algebra, we can't represent and thus don't have to worry about clauses with invalid extras. The subsequent changes I plan to make are: 1. Removing `python_version`, since we exclusively use `python_version_full` in the algebra. 2. Removing the deprecated aliases, such that we re-map to the correct marker value. 3. Consolidating `sys_platform` and `platform_release` (the original motivation).
charliermarsh
added a commit
that referenced
this pull request
Nov 26, 2024
By request: #9341 (review).
This file contains hidden or 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
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.
Summary
This PR introduces a set of parallel structs to
MarkerValueString,MarkerValueExtra, andMarkerValueVersionthat remove various pieces of information and representations that shouldn't be available in the marker algebra. To start, I've just removed the invalid extra component fromMarkerValueExtra-- there are no other changes to the representation. So, throughout the marker algebra, we can't represent and thus don't have to worry about clauses with invalid extras.The subsequent changes I plan to make are:
python_version, since we exclusively usepython_version_fullin the algebra.sys_platformandplatform_release(the original motivation).