Allow parsing lists of compound data types#49188
Closed
NickGerleman wants to merge 3 commits into
Closed
Conversation
Summary: Next up for transforms, and for some future cases, it is convenient to be able to export a single marker type like `CSSTransform`, that can expand to a variant of multiple possible types of different shape (e.g. `CSSMatrix3D` vs `CSSScale`). It is also best (for code size) to only have a single representation of compound types (e.g. `<CSSLength, CSSPercentage>` generates a separate copy of code compared to `<CSSPercentage, CSSLength>`). This diff introduces `CSSCompoundDataTypes` which allows composing types, which are then flattened out to discrete types during parsing. For simplicity, `CSSCompoundDataType` cannot currently be nested inside of other `CSSCompoundDataType`, though this could be added in the future. ``` /** * Marker for the <length-percentage> data type * https://drafts.csswg.org/css-values/#mixed-percentages */ using CSSLengthPercentage = CSSCompoundDataType<CSSLength, CSSPercentage>; ``` Changelog: [Internal] Reviewed By: lenaic Differential Revision: D69089416
Summary: `tolower` is not `constexpr`. Share some quick utilities for char to lowercase, and case insensitive comparision that does not create new string. Changelog: [Internal] Reviewed By: lenaic Differential Revision: D69134770
Summary: This allows creating lists of a compound data type, storing each element as a variant of the possible types, instead of as the specified type. Changelog: [Internal] Reviewed By: lenaic Differential Revision: D69142157
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D69142157 |
Contributor
|
This pull request has been merged in 1def9fd. |
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 allows creating lists of a compound data type, storing each element as a variant of the possible types, instead of as the specified type.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D69142157