Add RenameFieldsets transform#141
Closed
datdenkikniet wants to merge 1 commit intoembassy-rs:mainfrom
Closed
Conversation
8ca969c to
7ef23d8
Compare
7ef23d8 to
cb7fd05
Compare
Contributor
|
With this level of complexity I think a brief explanation of how the pieces fit together (e.g. when to use santitize, what its dependencies are) would be good for the top-level Beyond that, I think the |
Contributor
Author
|
Ah 🤦. Closing as this already exists as |
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.
For more context, see: #136 (comment)
The core issue is that when trying to generate unique names, we must use something to delimit the names. Underscores seems most sensible (alternatives are random-looking numbers at the end of strings, other random text). However, those unique names (i.e.
CFDRMDF_12andCFDRMDF_1_2) resolve to the same sanitized name (Cfdrmfd12). We have no way to not do that, assuming the following alternatives (and why I think they don't solve the problem) aren't preferable:Sanitize-ing, remove_as boundary, but only for fieldsets (lots more ugly names, weird special-casing for fieldset names)chiptooluser toMergeFieldsetson non-sanitized fieldsets (has exceptions: there's nothing preventing similarly-named fieldsets from being entirely different, so we may be forced toRenameFieldsets)DeleteFieldsets(prevents user from using certain fieldsets, quite sucky)Sanitize(how? Most (all?) other non-text characters are stripped when casing toPascalCase, so whatever we pick, it won't work)svd2ir: we can, of course, generate individualFieldSets for eachdim. Then fieldset names will be unique by SVD spec/requirement. (this throws away useful info directly provided by the SVD (= certain regs are identical), and forces users toMergeFieldsetson fieldsets that the SVD already tells us are identical.)With
RenameFieldsets, we don't have to do any additional special-casing. Just force the user to pick good names in case the ones uniquely generated bysvd2irare not immediately sanitizable.