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 *
|
static OpEntry *
|
||||||
NextOp(OpEntry *pp)
|
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);
|
pp = RepOpProp(pp->NextOfPE);
|
||||||
return (pp);
|
return (pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
Yap_IsOp(Atom at)
|
||||||
|
{
|
||||||
|
OpEntry *op = NextOp(RepOpProp((Prop)(RepAtom(at)->PropsOfAE)));
|
||||||
|
return (!EndOfPAEntr(op));
|
||||||
|
}
|
||||||
|
|
||||||
static Int
|
static Int
|
||||||
unify_op(OpEntry *op)
|
unify_op(OpEntry *op)
|
||||||
{
|
{
|
||||||
|
@ -216,14 +216,12 @@ legalAtom(unsigned char *s) /* Is this a legal atom ? */
|
|||||||
|
|
||||||
static int LeftOpToProtect(Atom at, int p)
|
static int LeftOpToProtect(Atom at, int p)
|
||||||
{
|
{
|
||||||
int op, rp;
|
return Yap_IsOp(at);
|
||||||
return Yap_IsPrefixOp(at, &op, &rp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int RightOpToProtect(Atom at, int p)
|
static int RightOpToProtect(Atom at, int p)
|
||||||
{
|
{
|
||||||
int op, lp;
|
return Yap_IsOp(at);
|
||||||
return Yap_IsPosfixOp(at, &op, &lp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static wtype
|
static wtype
|
||||||
|
@ -491,6 +491,7 @@ typedef enum
|
|||||||
OpEntry *STD_PROTO(Yap_GetOpProp,(Atom, op_type));
|
OpEntry *STD_PROTO(Yap_GetOpProp,(Atom, op_type));
|
||||||
|
|
||||||
int STD_PROTO(Yap_IsPrefixOp,(Atom,int *,int *));
|
int STD_PROTO(Yap_IsPrefixOp,(Atom,int *,int *));
|
||||||
|
int STD_PROTO(Yap_IsOp,(Atom));
|
||||||
int STD_PROTO(Yap_IsInfixOp,(Atom,int *,int *,int *));
|
int STD_PROTO(Yap_IsInfixOp,(Atom,int *,int *,int *));
|
||||||
int STD_PROTO(Yap_IsPosfixOp,(Atom,int *,int *));
|
int STD_PROTO(Yap_IsPosfixOp,(Atom,int *,int *));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user