Whether a module defines code to assemble (a function body or non-extern global). Header-only modules (only consts/types, e.g. `layout`) produce no object and are skipped by the closure.
(source: &str)
| 97 | generics, |
| 98 | is_extern: false, |
| 99 | .. |
| 100 | } if generics.is_empty() => Some(name.clone()), |
| 101 | DeclNode::Variable { |
| 102 | name, |
| 103 | is_extern: false, |
| 104 | .. |
| 105 | } => Some(name.clone()), |
| 106 | _ => None, |
| 107 | }) |
| 108 | .collect()) |
| 109 | } |
| 110 | |
| 111 | /// Exported names prefixed by a closure build without becoming link symbols: |
| 112 | /// interfaces, and generic functions the importer specializes into its own object. |
| 113 | pub fn collect_exported_interfaces(source: &str) -> Result<HashSet<String>, String> { |
| 114 | let program = parse_module(source)?; |
| 115 | Ok(program |
| 116 | .declarations |
| 117 | .iter() |
no test coverage detected