-
Notifications
You must be signed in to change notification settings - Fork 156
Change inflection on unions #212
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
Change inflection on unions #212
Conversation
Bummer. I'm not super opinionated on the naming here. Should we embrace uppercase and go for |
d89e1f4
to
d4fcccd
Compare
I switched it over to |
Hey, ACKing that I've seen this, I don't have strong opinions on naming (other than it should be consistent). I think I need some time to grok what is going on here, and see if I can think of anything clever. I probably will be able to get to this by Monday (feel free to re-ping me if I have forgotten :) ) |
ping @jamesmunns |
Argh. I knew there was something I was forgetting. Thanks @Emilgardis. I'm not crazy about naming the unions as upper case, as that is typically used for constants, and is a bit of a wierd interface for users. I'd rather have the naming "weird" for these edge cases, and less weird for normal usage, rather than making it equally weird for everyone. I don't want to hold up something that works, because I don't have particularly strong feelings about naming either. I guess my one bike shed thought would be to introduce something like
Or replacing
But honestly this is even bad, as it introduces a new, weird naming convention, or inserts a lot of noise into words. If no one really cares, lets go with UPPER_CASE for now, and have a follow up discussion before we move union support into the stable part of svd2rust edit: add the |
@jamesmunns re unions, we may want to move away from them, see #218 I'll wait a bit and then r+, let's see if anyone has a better solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#L10, unused import ToSanitizedPascalCase
PascalCase doesn't work when we have registers named `FOO_11` and `FOO1_1`. This happened in * Freescale MKL81Z7 * Freescale MKL82Z7 * Freescale MK81F25615 * Freescale MK82F25615 on `LTC0_PK*` registers.
d4fcccd
to
6e6b149
Compare
passed locally with svd2rust-regress, merging manually |
PascalCase doesn't work when we have overloaded registers named
FOO_11
andFOO1_1
.This happens in
on
LTC0_PK*
registers.I'm not sure if
{ident}Union
is the best choice anymore asFOO_BARUnion
doesn't seem as good as it possibly could be.cc @jamesmunns @wez