lpc-rs / lpc-pac

Peripheral Access Crates for LPC microcontrollers
9 stars 9 forks source link

Update svd2 rust #37

Closed axos88 closed 4 years ago

axos88 commented 5 years ago

Update to newest svd2rust version and regenerate all code.

(!) merge #35 first.

axos88 commented 5 years ago

I have no idea why svd2rust is generating that trailing underscore for the match_. Do you think this is a regression in svd2rust?

hannobraun commented 5 years ago

@axos88

I have no idea why svd2rust is generating that trailing underscore for the match_. Do you think this is a regression in svd2rust?

I don't know if this was handled in a different way previously, but match is a keyword and using it as a name for anything won't compile. The underscore is probably there to prevent this problem.

axos88 commented 5 years ago

@axos88

I have no idea why svd2rust is generating that trailing underscore for the match_. Do you think this is a regression in svd2rust?

I don't know if this was handled in a different way previously, but match is a keyword and using it as a name for anything won't compile. The underscore is probably there to prevent this problem.

Nope, if that was the case raw identifiers could be used

hannobraun commented 5 years ago

Nope, if that was the case raw identifiers could be used

I'm not aware of the reasoning for this specific design decision, but if I recall correctly, raw identifiers are only available since the 2018 edition, and svd2rust predates that by years. It's not a surprise if a design decision in svd2rust doesn't take all current language features into account.

axos88 commented 5 years ago

raw identifiers are only available since the 2018 edition,

You're right, didn't know this.

hannobraun commented 4 years ago

The svd2rust version used has been updated in #39. Closing.