Commit pending merge

This commit is contained in:
2025-04-30 22:13:09 +02:00
parent c9b349bccf
commit 1a25f52471
18 changed files with 198 additions and 129 deletions

View File

@@ -10,6 +10,7 @@ use orchid_base::name::Sym;
use crate::api;
use crate::ctx::Ctx;
use crate::dealias::absolute_path;
use crate::expr::Expr;
use crate::parsed::{ParsedMemberKind, ParsedModule};
use crate::system::System;
@@ -37,6 +38,34 @@ impl Module {
}
Self { members }
}
async fn walk(&self, mut path: impl Iterator<Item = Tok<String>>, ) -> &Self { todo!()}
async fn from_parsed(
parsed: &ParsedModule,
path: Sym,
parsed_root_path: Sym,
parsed_root: &ParsedModule,
root: &Module,
preload: &mut HashMap<Sym, Module>,
) -> Self {
let mut imported_names = Vec::new();
for import in parsed.get_imports() {
if let Some(n) = import.name.clone() {
imported_names.push(n);
continue;
}
// the path in a wildcard import has to be a module
if import.path.is_empty() {
panic!("Imported root")
}
if let Some(subpath) = import.path.strip_prefix(&parsed_root_path) {
let abs = absolute_path(&path, subpath);
// path is in parsed_root
} else {
// path is in root
}
}
todo!()
}
}
pub struct Member {