be less enthusiastsis about writing (op).
This commit is contained in:
parent
b4481ca98c
commit
5778730b62
16
C/stdpreds.c
16
C/stdpreds.c
@ -2960,6 +2960,22 @@ Yap_IsOp(Atom at)
|
||||
return (!EndOfPAEntr(op));
|
||||
}
|
||||
|
||||
int
|
||||
Yap_IsOpMaxPrio(Atom at)
|
||||
{
|
||||
OpEntry *op = NextOp(RepOpProp((Prop)(RepAtom(at)->PropsOfAE)));
|
||||
int max;
|
||||
|
||||
if (EndOfPAEntr(op))
|
||||
return 0;
|
||||
max = (op->Prefix & 0xfff);
|
||||
if ((op->Infix & 0xfff) > max)
|
||||
max = op->Infix & 0xfff;
|
||||
if ((op->Posfix & 0xfff) > max)
|
||||
max = op->Posfix & 0xfff;
|
||||
return max;
|
||||
}
|
||||
|
||||
static Int
|
||||
unify_op(OpEntry *op)
|
||||
{
|
||||
|
@ -214,12 +214,12 @@ legalAtom(unsigned char *s) /* Is this a legal atom ? */
|
||||
|
||||
static int LeftOpToProtect(Atom at, int p)
|
||||
{
|
||||
return Yap_IsOp(at);
|
||||
return Yap_IsOpMaxPrio(at) > p;
|
||||
}
|
||||
|
||||
static int RightOpToProtect(Atom at, int p)
|
||||
{
|
||||
return Yap_IsOp(at);
|
||||
return Yap_IsOpMaxPrio(at) > p;
|
||||
}
|
||||
|
||||
static wtype
|
||||
|
@ -316,6 +316,7 @@ void STD_PROTO(Yap_InitCPreds,(void));
|
||||
void STD_PROTO(Yap_show_statistics,(void));
|
||||
void STD_PROTO(Yap_signal,(yap_signals));
|
||||
void STD_PROTO(Yap_undo_signal,(yap_signals));
|
||||
int STD_PROTO(Yap_IsOpMaxPrio,(Atom));
|
||||
|
||||
/* sysbits.c */
|
||||
void STD_PROTO(Yap_set_fpu_exceptions,(int));
|
||||
|
Reference in New Issue
Block a user