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

@@ -15,14 +15,14 @@ impl ProjectError for UnexpectedDirectory {
"A stage that deals specifically with code encountered a path that refers \
to a directory"
}
fn one_position(&self, i: &Interner) -> crate::Location {
Location::File(Rc::new(i.extern_all(&self.path)))
fn one_position(&self) -> crate::Location {
Location::File(Rc::new(Interner::extern_all(&self.path)))
}
fn message(&self, i: &Interner) -> String {
fn message(&self) -> String {
format!(
"{} was expected to be a file but a directory was found",
i.extern_all(&self.path).join("/")
Interner::extern_all(&self.path).join("/")
)
}
}