use std::{collections::HashMap, path::PathBuf};
use derive_enum_from_into::EnumFrom;
use crate::{Diagnostic, Variable};
pub struct Module {
pub path: PathBuf,
}
pub struct SynthesizedModule {
pub module: Module,
pub(crate) exported_variables: HashMap<String, Variable>,
}
#[derive(Debug, EnumFrom)]
pub enum ModuleFromPathError {
ParseError(()),
PathDoesNotExist(PathBuf),
NoResolverForExtension(String),
}
impl From<ModuleFromPathError> for Diagnostic {
fn from(err: ModuleFromPathError) -> Self {
todo!()
}
}
impl SynthesizedModule {
pub fn get_exports(&self) -> &HashMap<String, Variable> {
&self.exported_variables
}
}