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

@@ -20,15 +20,15 @@ impl ProjectError for TooManySupers {
"an import path starts with more `super` segments than the current \
module's absolute path"
}
fn message(&self, i: &Interner) -> String {
fn message(&self) -> String {
format!(
"path {} in {} contains too many `super` steps.",
i.extern_all(&self.path).join("::"),
i.extern_all(&self.offender_mod).join("::")
Interner::extern_all(&self.path).join("::"),
Interner::extern_all(&self.offender_mod).join("::")
)
}
fn one_position(&self, i: &Interner) -> Location {
Location::File(Rc::new(i.extern_all(&self.offender_file)))
fn one_position(&self) -> Location {
Location::File(Rc::new(Interner::extern_all(&self.offender_file)))
}
}