Skip to content

Instantly share code, notes, and snippets.

@kennykerr
Created October 5, 2021 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennykerr/0acf856197f525c9eab3724c449a65c8 to your computer and use it in GitHub Desktop.
Save kennykerr/0acf856197f525c9eab3724c449a65c8 to your computer and use it in GitHub Desktop.
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