-
Notifications
You must be signed in to change notification settings - Fork 150
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
thread 'main' panicked at src/util.rs:95:9: "...%s" is not a valid Ident #811
Comments
Tested the similar patch for diff --git a/src/generate/register.rs b/src/generate/register.rs
index 5d83140..5b75711 100644
--- a/src/generate/register.rs
+++ b/src/generate/register.rs
@@ -1486,7 +1486,7 @@ fn base_syn_path(
let mut segments = Punctuated::new();
segments.push(path_segment(Ident::new("super", span)));
segments.push(path_segment(ident(
- &base.register().name,
+ &replace_suffix(&base.register().name, ""),
config,
"register_mod",
span, This produces correct code, although the accessor for |
Merged
@BrokenR3C0RD Can we close this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm working on patching and fixing up the SVD for the LPC11U1x/2x/3x series of MCUs. One of the modifications I made was to use
derivedFrom
in more places (so that the types used could also be used everywhere), and another was to add a generic set of IOCON registers. Part of the SVD in question<field derivedFrom="IOCON.PIO0[%s].MODE">
, however, causes svd2rust to panic withpio0%s is not a valid Ident
. I attempted to resolve this onmaster
by doing a patch similar to the followingThis leads to
svd2rust
not panicking, though it does produce invalid code for the IOCON RegisterBlock (return type ofPIO10
instead ofPIO1
for thepio1
method,&PIO10
instead of&PIO1
forpio1_iter
). I did a similar patch tocase-defaults
(#805), and this resulted in what appeared to be correct codegen.RUST_BACKTRACE=1
panic:The text was updated successfully, but these errors were encountered: