Converted Interner to work with Rc-s

- Interner no longer contains unsafe code
- Tokens now hold a reference to the value they represent directly

This will enable many future improvements
This commit is contained in:
2023-08-19 14:03:05 +01:00
parent ab0b57b1b8
commit 0b887ced70
62 changed files with 592 additions and 762 deletions

View File

@@ -96,11 +96,11 @@ impl<TItem: Clone, TExt: Clone> Module<TItem, TExt> {
callback: &mut impl FnMut(ModPath, &Self, &Import) -> Result<(), E>,
) -> Result<(), E> {
for import in self.imports.iter() {
callback(path, self, import)?
callback(path.clone(), self, import)?
}
for (name, entry) in self.items.iter() {
if let ModMember::Sub(module) = &entry.member {
module.visit_all_imports_rec(path.push(*name), callback)?
module.visit_all_imports_rec(path.push(name.clone()), callback)?
}
}
Ok(())