Skip to content

Add MapEnumVariants transform and supporting test.#131

Open
inferiorhumanorgans wants to merge 1 commit intoembassy-rs:mainfrom
inferiorhumanorgans:iho/map-enum-variants
Open

Add MapEnumVariants transform and supporting test.#131
inferiorhumanorgans wants to merge 1 commit intoembassy-rs:mainfrom
inferiorhumanorgans:iho/map-enum-variants

Conversation

@inferiorhumanorgans
Copy link
Copy Markdown
Contributor

This is useful when an SVD contains enum variants with purely numeric identifiers as Renesas is prone to doing.

It should/could potentially be extended to use regular expressions and merged with the existing RenameEnumVariants transform. However this is useful in cases where something akin to a RegexSet might be used, where RenameEnumVariants is more useful where a small number of variants need to be changed.

This could potentially be merged with AddEnumVariants but the current behavior is to simply ignore variants that don't match. That allows a single transform to be applied to slightly different variations of an enum.

This could potentially be merged with the RenameFields or more general Rename transform.

This is useful when an SVD contains enum variants with purely numeric
identifiers as Renesas is prone to doing.

It should/could potentially be extended to use regular expressions and
merged with the existing `RenameEnumVariants` transform. However this
is useful in cases where something akin to a `RegexSet` might be used,
where `RenameEnumVariants` is more useful where a small number of
variants need to be changed.

This could potentially be merged with `AddEnumVariants` but the current
behavior is to simply ignore variants that don't match.  That allows
a single transform to be applied to slightly different variations of
an enum.

This could potentially be merged with the `RenameFields` or more general
`Rename` transform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant