use super::symbol::SymbolId;
use crate::core::Span;
use std::collections::HashMap;
#[derive(Debug, Clone)]
pub struct Import {
pub path: String,
pub is_recursive: bool,
pub is_namespace: bool,
pub is_public: bool,
pub span: Option<Span>,
pub file: Option<String>,
}
#[derive(Debug, Clone)]
pub struct ResolvedImport {
pub raw_path: String,
pub resolved_path: String,
pub is_namespace: bool,
pub is_recursive: bool,
pub is_public: bool,
}
#[derive(Debug)]
pub struct Scope {
pub parent: Option<usize>,
pub symbols: HashMap<String, SymbolId>,
pub children: Vec<usize>,
pub imports: Vec<Import>,
pub resolved_imports: Vec<ResolvedImport>,
pub export_map: HashMap<String, SymbolId>,
}
impl Scope {
pub fn new(parent: Option<usize>) -> Self {
Self {
parent,
symbols: HashMap::new(),
children: Vec::new(),
imports: Vec::new(),
resolved_imports: Vec::new(),
export_map: HashMap::new(),
}
}
}