Skip to content

Commit

Permalink
codegen: Handle mangled types names
Browse files Browse the repository at this point in the history
Otherwise functions like match_ don't get documented
  • Loading branch information
bilelmoussaoui committed Jun 3, 2024
1 parent e0d63f0 commit d772c7d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/codegen/doc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ macro_rules! impl_to_stripper_type {
fn to_stripper_type(&self) -> TypeStruct {
TypeStruct::new(
SType::$enum_var,
&format!("connect_{}", nameutil::signal_to_snake(&self.name)),
&format!(
"connect_{}",
nameutil::mangle_keywords(nameutil::signal_to_snake(&self.name))
),
)
}
}
};
($ty:ident, $enum_var:ident) => {
impl ToStripperType for $ty {
fn to_stripper_type(&self) -> TypeStruct {
TypeStruct::new(SType::$enum_var, &self.name)
TypeStruct::new(SType::$enum_var, &nameutil::mangle_keywords(&self.name))
}
}
};
Expand Down Expand Up @@ -860,7 +863,7 @@ where

let mut st = fn_.to_stripper_type();
if let Some(name_override) = name_override {
st.name = name_override;
st.name = nameutil::mangle_keywords(name_override).to_string();
}
let ty = TypeStruct { parent, ..st };
let self_name: Option<String> = fn_
Expand Down

0 comments on commit d772c7d

Please sign in to comment.