throw exceptions when calling non-existent predicates. broken.

This commit is contained in:
Mark Thom
2018-04-08 15:17:58 -06:00
parent 32ebe1a47f
commit fe481fedce
6 changed files with 90 additions and 48 deletions

View File

@@ -180,7 +180,9 @@ impl Machine {
{
match self.code_dir.get(&(name.clone(), arity)) {
Some(&CodeIndex (_, ref mod_name)) if mod_name == &clause_name!("builtin") =>
return EvalSession::from(EvalError::ImpermissibleEntry(format!("{}/{}", name, arity))),
return EvalSession::from(EvalError::ImpermissibleEntry(format!("{}/{}",
name,
arity))),
_ => {}
};
@@ -192,7 +194,7 @@ impl Machine {
let entry = self.code_dir.entry((name, arity))
.or_insert(CodeIndex::from((offset, clause_name!("user"))));
entry.0.set(offset);
entry.0.set(IndexPtr::Index(offset));
entry.1 = clause_name!("user");
EvalSession::EntrySuccess