use rowan::TextRange;
use smol_str::SmolStr;
use super::binding::BindingId;
use super::scope::ScopeId;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum LoadKind {
Using,
Import,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ModulePath {
pub leading_dots: u32,
pub components: Vec<SmolStr>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ImportItem {
pub name: SmolStr,
pub alias: Option<SmolStr>,
pub range: TextRange,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ModuleLoad {
pub kind: LoadKind,
pub path: ModulePath,
pub alias: Option<SmolStr>,
pub items: Option<Vec<ImportItem>>,
pub range: TextRange,
pub scope: ScopeId,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Visibility {
Exported,
Public,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ExportEntry {
pub name: SmolStr,
pub visibility: Visibility,
pub range: TextRange,
pub scope: ScopeId,
pub binding: Option<BindingId>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct QualifiedRead {
pub path: Vec<SmolStr>,
pub range: TextRange,
pub scope: ScopeId,
pub is_macro: bool,
}