expand goals inside (\+)/1

This commit is contained in:
Mark Thom
2019-12-11 21:42:15 -07:00
parent 196784bd09
commit 02d8b1441d
14 changed files with 212 additions and 212 deletions

View File

@@ -134,33 +134,12 @@ impl CodeRepo {
);
Some(RefOrOwned::Owned(call_clause))
}
&CodePtr::CallN(arity, _, last_call) => {
let call_clause = call_clause!(ClauseType::CallN, arity, 0, last_call);
Some(RefOrOwned::Owned(call_clause))
}
&CodePtr::VerifyAttrInterrupt(p) => Some(RefOrOwned::Borrowed(&self.code[p])),
&CodePtr::DynamicTransaction(..) => None,
}
}
pub(super)
fn at_end_of_hook(&self, hook: CompileTimeHook, cp: LocalCodePtr) -> bool {
match hook {
CompileTimeHook::UserGoalExpansion | CompileTimeHook::GoalExpansion => {
let len = self.goal_expanders.len();
if len > 0 {
cp == LocalCodePtr::UserGoalExpansion(len - 1)
} else {
true
}
}
CompileTimeHook::UserTermExpansion | CompileTimeHook::TermExpansion => {
let len = self.term_expanders.len();
if len > 0 {
cp == LocalCodePtr::UserTermExpansion(len - 1)
} else {
true
}
}
}
}
}