correct misleading error for modules (#300)

This commit is contained in:
Mark Thom
2020-04-12 12:51:59 -06:00
parent 2ce4f602c0
commit 28099b9812
6 changed files with 106 additions and 22 deletions

View File

@@ -377,6 +377,19 @@ pub enum ModuleSource {
File(ClauseName),
}
impl ModuleSource {
pub fn as_functor_stub(&self) -> MachineStub {
match self {
ModuleSource::Library(ref name) => {
functor!("library", [clause_name(name.clone())])
}
ModuleSource::File(ref name) => {
functor!(clause_name(name.clone()))
}
}
}
}
pub type ScopedPredicateKey = (ClauseName, PredicateKey); // module name, predicate indicator.
#[derive(Clone)]