pub struct LoadedPackage {
pub program: Program,
pub imports_by_file: BTreeMap<String, BTreeSet<String>>,
pub module_prefixes: BTreeMap<String, String>,
}Expand description
A package loaded as one unit by load_package.
Fields§
§program: ProgramEvery file’s declarations, each exactly once, all prefix-mangled.
imports_by_file: BTreeMap<String, BTreeSet<String>>The stdlib modules each file imports itself, keyed by the file’s
path relative to the package root (src/schema.lex). Unlike
program, this is per-file: the flattening entry points cannot
report it, because by the time they return, a file’s imports and
those of everything it imports are one undifferentiated list.
module_prefixes: BTreeMap<String, String>Mangling prefix → the file it belongs to (schema_a1b2 →
src/schema.lex), for every file in the package. A declaration’s
mangled name is <prefix>.<local>, so this is what lets a
consumer attribute each declaration in program back to its
source file — the record export-git needs to de-flatten the
package into its src/*.lex tree (#894).