-
Notifications
You must be signed in to change notification settings - Fork 15
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
Handle runs of uppercase letters for name generation #218
Conversation
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.
The clippy error wasn't caused by this PR. It was caused from the rust version used on github being upgraded from 1.75 to 1.77. I didn't get it locally (on 1.75) but when I upgraded to 1.77 I did even on master
.
I ran the branch on the current spec to see and I noticed for example:
auxiliary_data =
shelley_format_aux_data ; @name shelley
/ shelley_ma_format_aux_data ; @name Shelley_m_a
/ conway_format_aux_data ; @name conway
which is how it is now produces shelleyma
as the variable instead of shelley_ma
like I would have expected. I tried changing it to ; @name ShelleyMA
and it's the same.
Is this the expected behavior?
I figured out the bug here (it happens even if the name is just What is happening is that the value passed to In both let variant_ident = VariantIdent::new_custom(convert_to_camel_case(&ident_name));
EnumVariant::new(variant_ident, ty, serialize_as_embedded) so if you start with
not sure what is the best way to solve this in the code without making a mess of everything |
e.g. `shelley_ma`
@SebastienGllmt I updated this and fixed the issues we had with things like |
Using dcSpark/cddl-codegen#218 and dcSpark/cddl-codegen#238 Also renames some cert fields to be clear as `coin` was not very helpful.
* Add documentation + fix acronym names Using dcSpark/cddl-codegen#218 and dcSpark/cddl-codegen#238 Also renames some cert fields to be clear as `coin` was not very helpful. * update multi-era crates too * clippy fix
* Add documentation + fix acronym names Using dcSpark/cddl-codegen#218 and dcSpark/cddl-codegen#238 Also renames some cert fields to be clear as `coin` was not very helpful. * update multi-era crates too * clippy fix
Previous handling of uppercase letters in
@name
generation was not idealNotably,
@name NFT
would result in the generated rust code having functions likenew_n_f_t
instead ofnew_nft
This PR should fix this.
Two other things this PR does:
WASM_BINDGEN_WEAKREF=1
that should be added to the generatedpackage.json