correct faulty removal of clauses in abolish/1

This commit is contained in:
Mark Thom
2021-02-08 18:46:33 -07:00
parent 30602c0849
commit cc7e21170f
5 changed files with 148 additions and 72 deletions

View File

@@ -720,7 +720,7 @@ impl Default for IndexStore {
}
impl IndexStore {
pub fn get_predicate_skeleton(
pub fn get_predicate_skeleton_mut(
&mut self,
compilation_target: &CompilationTarget,
key: &PredicateKey,
@@ -740,6 +740,26 @@ impl IndexStore {
}
}
pub fn get_predicate_skeleton(
&self,
compilation_target: &CompilationTarget,
key: &PredicateKey,
) -> Option<&PredicateSkeleton> {
match (key.0.as_str(), key.1) {
("term_expansion", 2) => self.extensible_predicates.get(key),
_ => match compilation_target {
CompilationTarget::User => self.extensible_predicates.get(key),
CompilationTarget::Module(ref module_name) => {
if let Some(module) = self.modules.get(module_name) {
module.extensible_predicates.get(key)
} else {
None
}
}
},
}
}
pub fn remove_predicate_skeleton(
&mut self,
compilation_target: &CompilationTarget,