| should use operator priority, not some built-in (#156)

This commit is contained in:
Vitor Santos Costa 2009-12-03 09:41:28 +00:00
parent 2d6934178b
commit 1bbf7ff16c

View File

@ -687,19 +687,20 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
} }
curprio = 1000; curprio = 1000;
continue; continue;
} else if (Unsigned(Yap_tokptr->TokInfo) == '|' && prio >= 1100 && } else if (Unsigned(Yap_tokptr->TokInfo) == '|' &&
curprio <= 1099) { IsInfixOp(AtomVBar, &opprio, &oplprio, &oprprio)
&& opprio <= prio && oplprio >= curprio) {
Volatile Term args[2]; Volatile Term args[2];
NextToken; NextToken;
args[0] = t; args[0] = t;
args[1] = ParseTerm(1100, FailBuff); args[1] = ParseTerm(oprprio, FailBuff);
t = Yap_MkApplTerm(FunctorVBar, 2, args); t = Yap_MkApplTerm(FunctorVBar, 2, args);
/* check for possible overflow against local stack */ /* check for possible overflow against local stack */
if (H > ASP-4096) { if (H > ASP-4096) {
Yap_ErrorMessage = "Stack Overflow"; Yap_ErrorMessage = "Stack Overflow";
FAIL; FAIL;
} }
curprio = 1100; curprio = opprio;
continue; continue;
} }
} }