mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix: errors in other modules are ignored
This commit is contained in:
parent
7ba874a85c
commit
eaeb659a7d
13 changed files with 214 additions and 75 deletions
|
@ -1,8 +1,11 @@
|
|||
use std::path::Path;
|
||||
|
||||
use erg_common::config::ErgConfig;
|
||||
|
||||
use crate::context::Context;
|
||||
|
||||
use super::cache::SharedModuleCache;
|
||||
use super::errors::{SharedCompileErrors, SharedCompileWarnings};
|
||||
use super::graph::SharedModuleGraph;
|
||||
use super::impls::SharedTraitImpls;
|
||||
use super::index::SharedModuleIndex;
|
||||
|
@ -19,6 +22,8 @@ pub struct SharedCompilerResource {
|
|||
/// e.g. { "Named": [(Type, Named), (Func, Named), ...], "Add": [(Nat, Add(Nat)), (Int, Add(Int)), ...], ... }
|
||||
pub trait_impls: SharedTraitImpls,
|
||||
pub promises: SharedPromises,
|
||||
pub errors: SharedCompileErrors,
|
||||
pub warns: SharedCompileWarnings,
|
||||
}
|
||||
|
||||
impl SharedCompilerResource {
|
||||
|
@ -32,6 +37,8 @@ impl SharedCompilerResource {
|
|||
graph: SharedModuleGraph::new(),
|
||||
trait_impls: SharedTraitImpls::new(),
|
||||
promises: SharedPromises::new(),
|
||||
errors: SharedCompileErrors::new(),
|
||||
warns: SharedCompileWarnings::new(),
|
||||
};
|
||||
Context::init_builtins(cfg, self_.clone());
|
||||
self_
|
||||
|
@ -43,5 +50,14 @@ impl SharedCompilerResource {
|
|||
self.index.initialize();
|
||||
self.graph.initialize();
|
||||
self.trait_impls.initialize();
|
||||
self.errors.clear();
|
||||
self.warns.clear();
|
||||
}
|
||||
|
||||
pub fn clear(&self, path: &Path) {
|
||||
self.mod_cache.remove(path);
|
||||
self.py_mod_cache.remove(path);
|
||||
self.index.remove_path(path);
|
||||
self.graph.remove(path);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue