This commit is contained in:
2026-03-24 13:40:27 +00:00
parent 4cee158206
commit e6cfef9a77
4 changed files with 237 additions and 31 deletions
+21 -1
View File
@@ -1,3 +1,4 @@
use prometeu_analysis::interner::NameInterner;
use std::path::PathBuf;
use std::sync::Arc;
@@ -11,11 +12,30 @@ pub struct SourceFile {
#[derive(Debug, Clone)]
pub struct FileManager {
files: Vec<SourceFile>,
interner: NameInterner,
}
impl FileManager {
pub fn new() -> Self {
Self { files: Vec::new() }
Self {
files: Vec::new(),
interner: NameInterner::new(),
}
}
pub fn with_interner(interner: NameInterner) -> Self {
Self {
files: Vec::new(),
interner,
}
}
pub fn interner(&self) -> &NameInterner {
&self.interner
}
pub fn interner_mut(&mut self) -> &mut NameInterner {
&mut self.interner
}
pub fn add(&mut self, path: PathBuf, source: String) -> usize {