INNER CODE UNIT · Rust
process_imports
dontpanic92/OpenPAL3 · crosscom/ccidl-rs/src/lib.rs:267
fn process_imports(idl_path: &Path, unit: &mut CrossComIdl) -> Result<(), Error> {
let root_canon = idl_path.canonicalize().map_err(|source| Error::Io {
path: idl_path.to_path_buf(),
source,
})?;
let mut visited: HashSet<PathBuf> = HashSet::new();
visited.insert(root_canon);
let root_dir = idl_path
.parent()
.unwrap_or_else(|| Path::new(""))
.to_path_buf();
// Pre-pass: for every direct import, look up the imported IDL's
// `module(protosept) X;` declaration (if any) and stash it on the
// Import struct so the p7 emitter can write `import X;` with the
// VFS-aware qualified path. Without this, the emitter falls back
// to the file stem (legacy single-segment shape).