sway_core/language/parsed/
module.rsuse crate::{
language::{HasModule, HasSubmodules, ModName, Visibility},
transform,
};
use super::ParseTree;
use sway_types::Span;
pub type ModuleHash = u64;
pub type ModuleEvaluationOrder = Vec<ModName>;
#[derive(Debug, Clone)]
pub struct ParseModule {
pub tree: ParseTree,
pub submodules: Vec<(ModName, ParseSubmodule)>,
pub attributes: transform::AttributesMap,
pub module_kind_span: Span,
pub module_eval_order: ModuleEvaluationOrder,
pub span: Span,
pub hash: ModuleHash,
}
#[derive(Debug, Clone)]
pub struct ParseSubmodule {
pub module: ParseModule,
pub mod_name_span: Span,
pub visibility: Visibility,
}
impl HasModule<ParseModule> for ParseSubmodule {
fn module(&self) -> &ParseModule {
&self.module
}
}
impl HasSubmodules<ParseSubmodule> for ParseModule {
fn submodules(&self) -> &[(ModName, ParseSubmodule)] {
&self.submodules
}
}