Skip to content

Instantly share code, notes, and snippets.

@kennykerr
Created Oct 5, 2021
Embed
What would you like to do?
fn main() {
use reader::*;
let reader = TypeReader::get_mut();
fn walk(tree: &TypeTree) {
for (_, entry) in &tree.types {
match &entry.def {
ElementType::TypeDef(def) => {
if def.has_attribute("SupportedArchitectureAttribute") {
assert!(def.kind() == TypeKind::Struct || def.kind() == TypeKind::Delegate);
println!("{}", def.type_name());
}
}
_ => {}
}
}
tree.namespaces.values().for_each(|tree| walk(&tree));
}
walk(&reader.types);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment