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);
|
READ_LOCK(ae->ARWLock);
|
||||||
pp = RepProp(ae->PropsOfAE);
|
pp = RepProp(ae->PropsOfAE);
|
||||||
while (!EndOfPAEntr(pp) &&
|
while (!EndOfPAEntr(pp) &&
|
||||||
pp->KindOfPE != OpProperty &&
|
( pp->KindOfPE != OpProperty ||
|
||||||
((OpEntry *)pp)->OpModule &&
|
(((OpEntry *)pp)->OpModule &&
|
||||||
((OpEntry *)pp)->OpModule != CurrentModule)
|
((OpEntry *)pp)->OpModule != CurrentModule)))
|
||||||
pp = RepProp(pp->NextOfPE);
|
pp = RepProp(pp->NextOfPE);
|
||||||
READ_UNLOCK(ae->ARWLock);
|
READ_UNLOCK(ae->ARWLock);
|
||||||
if (EndOfPAEntr(pp))
|
if (EndOfPAEntr(pp))
|
||||||
|
88
C/parser.c
88
C/parser.c
@ -416,14 +416,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
switch (Yap_tokptr->Tok) {
|
switch (Yap_tokptr->Tok) {
|
||||||
case Name_tok:
|
case Name_tok:
|
||||||
t = Yap_tokptr->TokInfo;
|
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;
|
NextToken;
|
||||||
if ((Yap_tokptr->Tok != Ord(Ponctuation_tok)
|
if ((Yap_tokptr->Tok != Ord(Ponctuation_tok)
|
||||||
|| Unsigned(Yap_tokptr->TokInfo) != 'l')
|
|| Unsigned(Yap_tokptr->TokInfo) != 'l')
|
||||||
@ -434,14 +426,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
if (Yap_tokptr->Tok == Number_tok) {
|
if (Yap_tokptr->Tok == Number_tok) {
|
||||||
if ((Atom)t == AtomMinus) {
|
if ((Atom)t == AtomMinus) {
|
||||||
t = Yap_tokptr->TokInfo;
|
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))
|
if (IsIntTerm(t))
|
||||||
t = MkIntTerm(-IntOfTerm(t));
|
t = MkIntTerm(-IntOfTerm(t));
|
||||||
else if (IsFloatTerm(t))
|
else if (IsFloatTerm(t))
|
||||||
@ -457,25 +441,9 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
else
|
else
|
||||||
t = MkLongIntTerm(-LongIntOfTerm(t));
|
t = MkLongIntTerm(-LongIntOfTerm(t));
|
||||||
NextToken;
|
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;
|
break;
|
||||||
} else if ((Atom)t == AtomPlus) {
|
} else if ((Atom)t == AtomPlus) {
|
||||||
t = Yap_tokptr->TokInfo;
|
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;
|
NextToken;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -555,14 +523,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
if ((t = varinfo->VarAdr) == TermNil) {
|
if ((t = varinfo->VarAdr) == TermNil) {
|
||||||
t = varinfo->VarAdr = MkVarTerm();
|
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;
|
NextToken;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -575,27 +535,11 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
case 'l': /* non solo ( */
|
case 'l': /* non solo ( */
|
||||||
NextToken;
|
NextToken;
|
||||||
t = ParseTerm(1200, FailBuff);
|
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);
|
checkfor((Term) ')', FailBuff);
|
||||||
break;
|
break;
|
||||||
case '[':
|
case '[':
|
||||||
NextToken;
|
NextToken;
|
||||||
t = ParseList(FailBuff);
|
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);
|
checkfor((Term) ']', FailBuff);
|
||||||
break;
|
break;
|
||||||
case '{':
|
case '{':
|
||||||
@ -660,14 +604,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
&& opprio <= prio && oplprio >= curprio) {
|
&& opprio <= prio && oplprio >= curprio) {
|
||||||
/* parse as posfix operator */
|
/* parse as posfix operator */
|
||||||
t = Yap_MkApplTerm(Yap_MkFunctor((Atom) Yap_tokptr->TokInfo, 1), 1, &t);
|
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 */
|
/* check for possible overflow against local stack */
|
||||||
if (H > ASP-4096) {
|
if (H > ASP-4096) {
|
||||||
Yap_ErrorMessage = "Stack Overflow";
|
Yap_ErrorMessage = "Stack Overflow";
|
||||||
@ -687,14 +623,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
args[0] = t;
|
args[0] = t;
|
||||||
args[1] = ParseTerm(1000, FailBuff);
|
args[1] = ParseTerm(1000, FailBuff);
|
||||||
t = Yap_MkApplTerm(Yap_MkFunctor(AtomComma, 2), 2, args);
|
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 */
|
/* check for possible overflow against local stack */
|
||||||
if (H > ASP-4096) {
|
if (H > ASP-4096) {
|
||||||
Yap_ErrorMessage = "Stack Overflow";
|
Yap_ErrorMessage = "Stack Overflow";
|
||||||
@ -709,14 +637,6 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
args[0] = t;
|
args[0] = t;
|
||||||
args[1] = ParseTerm(1100, FailBuff);
|
args[1] = ParseTerm(1100, FailBuff);
|
||||||
t = Yap_MkApplTerm(FunctorVBar, 2, args);
|
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 */
|
/* check for possible overflow against local stack */
|
||||||
if (H > ASP-4096) {
|
if (H > ASP-4096) {
|
||||||
Yap_ErrorMessage = "Stack Overflow";
|
Yap_ErrorMessage = "Stack Overflow";
|
||||||
@ -730,6 +650,14 @@ ParseTerm(int prio, JMPBUFF *FailBuff)
|
|||||||
FAIL;
|
FAIL;
|
||||||
break;
|
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;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user