From 1bbf7ff16c1c3e7771c3bccf4d4c87f3ecd49f99 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 3 Dec 2009 09:41:28 +0000 Subject: [PATCH] | should use operator priority, not some built-in (#156) --- C/parser.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/C/parser.c b/C/parser.c index 62ebd43cd..1ad461938 100644 --- a/C/parser.c +++ b/C/parser.c @@ -687,19 +687,20 @@ ParseTerm(int prio, JMPBUFF *FailBuff) } curprio = 1000; continue; - } else if (Unsigned(Yap_tokptr->TokInfo) == '|' && prio >= 1100 && - curprio <= 1099) { + } else if (Unsigned(Yap_tokptr->TokInfo) == '|' && + IsInfixOp(AtomVBar, &opprio, &oplprio, &oprprio) + && opprio <= prio && oplprio >= curprio) { Volatile Term args[2]; NextToken; args[0] = t; - args[1] = ParseTerm(1100, FailBuff); + args[1] = ParseTerm(oprprio, FailBuff); t = Yap_MkApplTerm(FunctorVBar, 2, args); /* check for possible overflow against local stack */ if (H > ASP-4096) { Yap_ErrorMessage = "Stack Overflow"; FAIL; } - curprio = 1100; + curprio = opprio; continue; } }