MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / module_member_aliases

Function module_member_aliases

src/compilation_pipeline.rs:1281–1327  ·  view source on GitHub ↗
(
    alias: &str,
    key: &str,
    exports: &std::collections::HashSet<String>,
)

Source from the content-addressed store, hash-verified

1279 continue;
1280 }
1281 match aliases.get(short) {
1282 Some(existing) if existing != *export => {
1283 aliases.remove(short);
1284 }
1285 Some(_) => {}
1286 None => {
1287 aliases.insert(short.to_owned(), (*export).clone());
1288 }
1289 }
1290 }
1291 }
1292 for export in &sorted_exports {
1293 if let Some(short) = export.strip_prefix('k')
1294 && short
1295 .chars()
1296 .next()
1297 .is_some_and(|ch| ch.is_ascii_lowercase())
1298 {
1299 aliases
1300 .entry(short.to_owned())
1301 .or_insert_with(|| (*export).clone());
1302 }
1303 }
1304 aliases
1305}
1306
1307fn source_identity(name: &str, source_path: Option<&Path>) -> String {
1308 source_path
1309 .map(|path| path.display().to_string())
1310 .unwrap_or_else(|| name.to_owned())
1311}
1312
1313fn mark_all_defined_symbols_global(assembled: &mut AssembledOutput) {
1314 let symbols: Vec<String> = assembled
1315 .symbols_iter()
1316 .filter(|(name, _addr)| is_legacy_export_symbol(name))
1317 .map(|(name, _addr)| name.to_owned())
1318 .collect();
1319 for symbol in symbols {
1320 assembled.mark_entry_global(&symbol);
1321 }
1322}
1323
1324fn is_legacy_export_symbol(name: &str) -> bool {
1325 !name.starts_with('.') && !name.contains("__")
1326}
1327
1328fn programs_module_resolver(name: &str) -> Option<String> {
1329 bundled_module_source(name).map(str::to_owned)
1330}

Callers 1

resolve_modulesMethod · 0.70

Calls 4

collectMethod · 0.80
getMethod · 0.80
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected