make modules remember which operators they ever defined.

Make modules import operators from other modules
This commit is contained in:
Vitor Santos Costa
2016-04-28 15:01:16 +01:00
parent 61ba15fa3a
commit 70061308ff
8 changed files with 126 additions and 32 deletions

View File

@@ -1060,6 +1060,25 @@ static Int init_current_atom_op(
return cont_current_atom_op(PASS_REGS1);
}
static Int copy_local_ops (USES_REGS1) { /* current_op(-Precedence,-Type,-Atom) */
Term tmodin = Deref(ARG1);
Term t = Deref(ARG1);
AtomEntry *ae;
OpEntry *ope;
if (IsVarTerm(t) || !IsAtomTerm(t)) {
Yap_Error(TYPE_ERROR_ATOM, t, "current_op/3");
cut_fail();
}
ae = RepAtom(AtomOfTerm(t));
if (EndOfPAEntr((ope = NextOp(RepOpProp(ae->PropsOfAE) PASS_REGS)))) {
cut_fail();
}
EXTRA_CBACK_ARG(5, 1) = (CELL)MkIntegerTerm((Int)ope);
B->cp_h = HR;
return cont_current_atom_op(PASS_REGS1);
}
void Yap_show_statistics(void) {
CACHE_REGS
unsigned long int heap_space_taken;