make write always protect operators when they are not used as operators so as to follow standard (#150).
This commit is contained in:
parent
69988d0718
commit
506da0b1bf
10
C/stdpreds.c
10
C/stdpreds.c
@ -2869,11 +2869,19 @@ init_current_predicate_for_atom(void)
|
||||
static OpEntry *
|
||||
NextOp(OpEntry *pp)
|
||||
{
|
||||
while (!EndOfPAEntr(pp) && pp->KindOfPE != OpProperty)
|
||||
while (!EndOfPAEntr(pp) && pp->KindOfPE != OpProperty &&
|
||||
(pp->OpModule != PROLOG_MODULE || pp->OpModule != CurrentModule))
|
||||
pp = RepOpProp(pp->NextOfPE);
|
||||
return (pp);
|
||||
}
|
||||
|
||||
int
|
||||
Yap_IsOp(Atom at)
|
||||
{
|
||||
OpEntry *op = NextOp(RepOpProp((Prop)(RepAtom(at)->PropsOfAE)));
|
||||
return (!EndOfPAEntr(op));
|
||||
}
|
||||
|
||||
static Int
|
||||
unify_op(OpEntry *op)
|
||||
{
|
||||
|
@ -216,14 +216,12 @@ legalAtom(unsigned char *s) /* Is this a legal atom ? */
|
||||
|
||||
static int LeftOpToProtect(Atom at, int p)
|
||||
{
|
||||
int op, rp;
|
||||
return Yap_IsPrefixOp(at, &op, &rp);
|
||||
return Yap_IsOp(at);
|
||||
}
|
||||
|
||||
static int RightOpToProtect(Atom at, int p)
|
||||
{
|
||||
int op, lp;
|
||||
return Yap_IsPosfixOp(at, &op, &lp);
|
||||
return Yap_IsOp(at);
|
||||
}
|
||||
|
||||
static wtype
|
||||
|
Reference in New Issue
Block a user