Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 227 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ members = ["crates/*"]
opt-level = 3

[profile.dev]
# Speeds up the build. May need to diable for debugging.
# Speeds up the build. May need to disable for debugging.
debug = 0
2 changes: 2 additions & 0 deletions crates/analyzer/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ pub trait AnalyzerDb: SourceDb + Upcast<dyn SourceDb> + UpcastMut<dyn SourceDb>
fn module_submodules(&self, module: ModuleId) -> Rc<[ModuleId]>;
#[salsa::invoke(queries::module::module_tests)]
fn module_tests(&self, module: ModuleId) -> Vec<FunctionId>;
#[salsa::invoke(queries::module::module_invariants)]
fn module_invariants(&self, module: ModuleId) -> Vec<FunctionId>;

// Module Constant
#[salsa::cycle(queries::module::module_constant_type_cycle)]
Expand Down
9 changes: 9 additions & 0 deletions crates/analyzer/src/db/queries/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,3 +760,12 @@ pub fn module_tests(db: &dyn AnalyzerDb, ingot: ModuleId) -> Vec<FunctionId> {
.filter(|function| function.is_test(db))
.collect()
}

pub fn module_invariants(db: &dyn AnalyzerDb, ingot: ModuleId) -> Vec<FunctionId> {
ingot
.all_functions(db)
.iter()
.copied()
.filter(|function| function.is_invariant(db))
.collect()
}
Loading