fix op search code.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1461 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
4d34b03726
commit
7cd5cafe1c
@ -313,9 +313,9 @@ Yap_GetOpProp(Atom a)
|
||||
READ_LOCK(ae->ARWLock);
|
||||
pp = RepProp(ae->PropsOfAE);
|
||||
while (!EndOfPAEntr(pp) &&
|
||||
pp->KindOfPE != OpProperty &&
|
||||
((OpEntry *)pp)->OpModule &&
|
||||
((OpEntry *)pp)->OpModule != CurrentModule)
|
||||
( pp->KindOfPE != OpProperty ||
|
||||
(((OpEntry *)pp)->OpModule &&
|
||||
((OpEntry *)pp)->OpModule != CurrentModule)))
|
||||
pp = RepProp(pp->NextOfPE);
|
||||
READ_UNLOCK(ae->ARWLock);
|
||||
if (EndOfPAEntr(pp))
|
||||
|
88
C/parser.c
88
C/parser.c
@ -416,14 +416,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
switch (Yap_tokptr->Tok) {
|
||||
case Name_tok:
|
||||
t = Yap_tokptr->TokInfo;
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
NextToken;
|
||||
if ((Yap_tokptr->Tok != Ord(Ponctuation_tok)
|
||||
|| Unsigned(Yap_tokptr->TokInfo) != 'l')
|
||||
@ -434,14 +426,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
if (Yap_tokptr->Tok == Number_tok) {
|
||||
if ((Atom)t == AtomMinus) {
|
||||
t = Yap_tokptr->TokInfo;
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
if (IsIntTerm(t))
|
||||
t = MkIntTerm(-IntOfTerm(t));
|
||||
else if (IsFloatTerm(t))
|
||||
@ -457,25 +441,9 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
else
|
||||
t = MkLongIntTerm(-LongIntOfTerm(t));
|
||||
NextToken;
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
} else if ((Atom)t == AtomPlus) {
|
||||
t = Yap_tokptr->TokInfo;
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
NextToken;
|
||||
break;
|
||||
}
|
||||
@ -555,14 +523,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
if ((t = varinfo->VarAdr) == TermNil) {
|
||||
t = varinfo->VarAdr = MkVarTerm();
|
||||
}
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
NextToken;
|
||||
break;
|
||||
|
||||
@ -575,27 +535,11 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
case 'l': /* non solo ( */
|
||||
NextToken;
|
||||
t = ParseTerm(1200, FailBuff);
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
checkfor((Term) ')', FailBuff);
|
||||
break;
|
||||
case '[':
|
||||
NextToken;
|
||||
t = ParseList(FailBuff);
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
checkfor((Term) ']', FailBuff);
|
||||
break;
|
||||
case '{':
|
||||
@ -660,14 +604,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
&& opprio <= prio && oplprio >= curprio) {
|
||||
/* parse as posfix operator */
|
||||
t = Yap_MkApplTerm(Yap_MkFunctor((Atom) Yap_tokptr->TokInfo, 1), 1, &t);
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
/* check for possible overflow against local stack */
|
||||
if (H > ASP-4096) {
|
||||
Yap_ErrorMessage = "Stack Overflow";
|
||||
@ -687,14 +623,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
args[0] = t;
|
||||
args[1] = ParseTerm(1000, FailBuff);
|
||||
t = Yap_MkApplTerm(Yap_MkFunctor(AtomComma, 2), 2, args);
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
/* check for possible overflow against local stack */
|
||||
if (H > ASP-4096) {
|
||||
Yap_ErrorMessage = "Stack Overflow";
|
||||
@ -709,14 +637,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
args[0] = t;
|
||||
args[1] = ParseTerm(1100, FailBuff);
|
||||
t = Yap_MkApplTerm(FunctorVBar, 2, args);
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
/* check for possible overflow against local stack */
|
||||
if (H > ASP-4096) {
|
||||
Yap_ErrorMessage = "Stack Overflow";
|
||||
@ -730,6 +650,14 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
||||
FAIL;
|
||||
break;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
if (Yap_Option['p' - 'a' + 1]) {
|
||||
Yap_DebugPutc(Yap_c_error_stream,'[');
|
||||
Yap_plwrite (t, Yap_DebugPutc, 0);
|
||||
Yap_DebugPutc(Yap_c_error_stream,']');
|
||||
Yap_DebugPutc(Yap_c_error_stream,'\n');
|
||||
}
|
||||
#endif
|
||||
return t;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user