errors
This commit is contained in:
parent
48bcffdce7
commit
c1d81ea7c6
2
C/args.c
2
C/args.c
@ -43,7 +43,7 @@ int Yap_ArgKey(Atom key, const param_t *def, int n) {
|
||||
static xarg *failed__(yap_error_number e, Term t, xarg *a USES_REGS) {
|
||||
free(a);
|
||||
LOCAL_ActiveError->errorNo = e;
|
||||
LOCAL_ActiveError->rawErrorTerm = t;
|
||||
LOCAL_ActiveError->errorRawTerm = t;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1454,8 +1454,7 @@ X_API Term YAP_ReadBuffer(const char *s, Term *tp) {
|
||||
else
|
||||
tv = (Term)0;
|
||||
LOCAL_ErrorMessage = NULL;
|
||||
const unsigned char *us = (const unsigned char *)s;
|
||||
while (!(t = Yap_BufferToTermWithPrioBindings(us, TermNil, tv, strlen(s) + 1, GLOBAL_MaxPriority))) {
|
||||
while (!(t = Yap_BufferToTermWithPrioBindings(s, TermNil, tv, strlen(s) + 1, GLOBAL_MaxPriority))) {
|
||||
if (LOCAL_ErrorMessage) {
|
||||
if (!strcmp(LOCAL_ErrorMessage, "Stack Overflow")) {
|
||||
if (!Yap_dogc(0, NULL PASS_REGS)) {
|
||||
@ -2091,9 +2090,7 @@ X_API void YAP_PruneGoal(YAP_dogoalinfo *gi) {
|
||||
X_API bool YAP_GoalHasException(Term *t) {
|
||||
CACHE_REGS
|
||||
BACKUP_MACHINE_REGS();
|
||||
if (t)
|
||||
*t = Yap_PeekException();
|
||||
return Yap_PeekException();
|
||||
return LOCAL_ActiveError->errorNo != YAP_NO_ERROR;
|
||||
}
|
||||
|
||||
X_API void YAP_ClearExceptions(void) {
|
||||
@ -2254,11 +2251,12 @@ X_API int YAP_WriteDynamicBuffer(YAP_Term t, char *buf, size_t sze,
|
||||
return true;
|
||||
}
|
||||
|
||||
X_API char *YAP_CompileClause(Term t) {
|
||||
X_API bool YAP_CompileClause(Term t) {
|
||||
CACHE_REGS
|
||||
yamop *codeaddr;
|
||||
Term mod = CurrentModule;
|
||||
Term tn = TermNil;
|
||||
bool ok = true;
|
||||
|
||||
BACKUP_MACHINE_REGS();
|
||||
|
||||
@ -2267,12 +2265,14 @@ X_API char *YAP_CompileClause(Term t) {
|
||||
ARG1 = t;
|
||||
YAPEnterCriticalSection();
|
||||
codeaddr = Yap_cclause(t, 0, mod, t);
|
||||
if (codeaddr != NULL) {
|
||||
ok = (codeaddr != NULL);
|
||||
if (ok) {
|
||||
t = Deref(ARG1); /* just in case there was an heap overflow */
|
||||
if (!Yap_addclause(t, codeaddr, TermAssertz, mod, &tn)) {
|
||||
YAPLeaveCriticalSection();
|
||||
return LOCAL_ErrorMessage;
|
||||
ok = false;
|
||||
}
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
YAPLeaveCriticalSection();
|
||||
|
||||
@ -2280,10 +2280,16 @@ X_API char *YAP_CompileClause(Term t) {
|
||||
if (!Yap_locked_growheap(FALSE, 0, NULL)) {
|
||||
Yap_Error(RESOURCE_ERROR_HEAP, TermNil, "YAP failed to grow heap: %s",
|
||||
LOCAL_ErrorMessage);
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
RECOVER_MACHINE_REGS();
|
||||
return (LOCAL_ErrorMessage);
|
||||
if (!ok) {
|
||||
t = Yap_GetException();
|
||||
Yap_DebugPlWrite(t);
|
||||
return NULL;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
X_API void YAP_PutValue(YAP_Atom at, Term t) { Yap_PutValue(at, t); }
|
||||
@ -2339,7 +2345,9 @@ X_API void YAP_FlushAllStreams(void) {
|
||||
|
||||
X_API void YAP_Throw(Term t) {
|
||||
BACKUP_MACHINE_REGS();
|
||||
Yap_JumpToEnv(t);
|
||||
LOCAL_ActiveError->errorNo = THROW_EVENT;
|
||||
LOCAL_ActiveError->errorGoal = Yap_TermToBuffer(t, LOCAL_encoding, 0);
|
||||
Yap_JumpToEnv();
|
||||
RECOVER_MACHINE_REGS();
|
||||
}
|
||||
|
||||
@ -2347,7 +2355,9 @@ X_API void YAP_AsyncThrow(Term t) {
|
||||
CACHE_REGS
|
||||
BACKUP_MACHINE_REGS();
|
||||
LOCAL_PrologMode |= AsyncIntMode;
|
||||
Yap_JumpToEnv(t);
|
||||
LOCAL_ActiveError->errorNo = THROW_EVENT;
|
||||
LOCAL_ActiveError->errorGoal = Yap_TermToBuffer(t, LOCAL_encoding, 0);
|
||||
Yap_JumpToEnv();
|
||||
LOCAL_PrologMode &= ~AsyncIntMode;
|
||||
RECOVER_MACHINE_REGS();
|
||||
}
|
||||
|
56
C/cdmgr.c
56
C/cdmgr.c
@ -1453,27 +1453,33 @@ static int not_was_reconsulted(PredEntry *p, Term t, int mode) {
|
||||
return TRUE; /* careful */
|
||||
}
|
||||
|
||||
static void addcl_permission_error(AtomEntry *ap, Int Arity, int in_use) {
|
||||
static yamop * addcl_permission_error(const char *file, const char *function, int lineno, AtomEntry *ap, Int Arity, int in_use) {
|
||||
CACHE_REGS
|
||||
|
||||
LOCAL_Error_TYPE = PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE;
|
||||
LOCAL_ErrorMessage = Malloc(256);
|
||||
|
||||
if (in_use) {
|
||||
if (Arity == 0)
|
||||
sprintf(LOCAL_ErrorMessage, "static predicate %s is in use", ap->StrOfAE);
|
||||
Term culprit;
|
||||
if (Arity == 0)
|
||||
culprit = MkAtomTerm(AbsAtom(ap));
|
||||
else
|
||||
sprintf(LOCAL_ErrorMessage,
|
||||
"static predicate %s/" Int_FORMAT " is in use", ap->StrOfAE,
|
||||
Arity);
|
||||
} else {
|
||||
if (Arity == 0)
|
||||
sprintf(LOCAL_ErrorMessage, "system predicate %s", ap->StrOfAE);
|
||||
else
|
||||
sprintf(LOCAL_ErrorMessage, "system predicate %s/" Int_FORMAT,
|
||||
ap->StrOfAE, Arity);
|
||||
}
|
||||
}
|
||||
culprit = Yap_MkNewApplTerm(Yap_MkFunctor(AbsAtom(ap),Arity), Arity);
|
||||
return
|
||||
(in_use ?
|
||||
(Arity == 0 ?
|
||||
Yap_Error__(false, file, function, lineno, PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, culprit,
|
||||
"static predicate %s is in use", ap->StrOfAE)
|
||||
:
|
||||
Yap_Error__(false, file, function, lineno, PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, culprit,
|
||||
"static predicate %s/" Int_FORMAT " is in use", ap->StrOfAE, Arity)
|
||||
)
|
||||
:
|
||||
(Arity == 0 ?
|
||||
Yap_Error__(false, file, function, lineno, PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, culprit,
|
||||
"system predicate %s is in use", ap->StrOfAE)
|
||||
:
|
||||
Yap_Error__(false, file, function, lineno, PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, culprit,
|
||||
"system predicate %s/" Int_FORMAT, ap->StrOfAE, Arity)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
PredEntry *Yap_PredFromClause(Term t USES_REGS) {
|
||||
Term cmod = LOCAL_SourceModule;
|
||||
@ -1729,7 +1735,7 @@ bool Yap_addclause(Term t, yamop *cp, Term tmode, Term mod, Term *t4ref)
|
||||
PELOCK(20, p);
|
||||
/* we are redefining a prolog module predicate */
|
||||
if (Yap_constPred(p)) {
|
||||
addcl_permission_error(RepAtom(at), Arity, FALSE);
|
||||
addcl_permission_error(__FILE__, __FUNCTION__, __LINE__, RepAtom(at), Arity, FALSE);
|
||||
UNLOCKPE(30, p);
|
||||
return false;
|
||||
}
|
||||
@ -2430,12 +2436,12 @@ static Int new_multifile(USES_REGS1) {
|
||||
}
|
||||
if (pe->PredFlags & (TabledPredFlag | ForeignPredFlags)) {
|
||||
UNLOCKPE(26, pe);
|
||||
addcl_permission_error(RepAtom(at), arity, FALSE);
|
||||
addcl_permission_error(__FILE__, __FUNCTION__, __LINE__,RepAtom(at), arity, FALSE);
|
||||
return false;
|
||||
}
|
||||
if (pe->cs.p_code.NOfClauses) {
|
||||
UNLOCKPE(26, pe);
|
||||
addcl_permission_error(RepAtom(at), arity, FALSE);
|
||||
addcl_permission_error(__FILE__, __FUNCTION__, __LINE__,RepAtom(at), arity, FALSE);
|
||||
return false;
|
||||
}
|
||||
pe->PredFlags &= ~UndefPredFlag;
|
||||
@ -2669,7 +2675,7 @@ static Int mk_dynamic(USES_REGS1) { /* '$make_dynamic'(+P) */
|
||||
(UserCPredFlag | CArgsPredFlag | NumberDBPredFlag | AtomDBPredFlag |
|
||||
TestPredFlag | AsmPredFlag | CPredFlag | BinaryPredFlag)) {
|
||||
UNLOCKPE(30, pe);
|
||||
addcl_permission_error(RepAtom(at), arity, FALSE);
|
||||
addcl_permission_error(__FILE__, __FUNCTION__, __LINE__,RepAtom(at), arity, FALSE);
|
||||
return false;
|
||||
}
|
||||
if (pe->PredFlags & LogUpdatePredFlag) {
|
||||
@ -2682,7 +2688,7 @@ static Int mk_dynamic(USES_REGS1) { /* '$make_dynamic'(+P) */
|
||||
}
|
||||
if (pe->cs.p_code.NOfClauses != 0) {
|
||||
UNLOCKPE(26, pe);
|
||||
addcl_permission_error(RepAtom(at), arity, FALSE);
|
||||
addcl_permission_error(__FILE__, __FUNCTION__, __LINE__, RepAtom(at), arity, FALSE);
|
||||
return false;
|
||||
}
|
||||
if (pe->OpcodeOfPred == UNDEF_OPCODE) {
|
||||
@ -2732,7 +2738,7 @@ static Int new_meta_pred(USES_REGS1) {
|
||||
}
|
||||
if (pe->cs.p_code.NOfClauses) {
|
||||
UNLOCKPE(26, pe);
|
||||
addcl_permission_error(RepAtom(at), arity, FALSE);
|
||||
addcl_permission_error(__FILE__, __FUNCTION__, __LINE__, RepAtom(at), arity, FALSE);
|
||||
return false;
|
||||
}
|
||||
pe->PredFlags |= MetaPredFlag;
|
||||
|
26
C/dbase.c
26
C/dbase.c
@ -259,7 +259,7 @@ static Int p_rcdz(USES_REGS1);
|
||||
static Int p_rcdzp(USES_REGS1);
|
||||
static Int p_drcdap(USES_REGS1);
|
||||
static Int p_drcdzp(USES_REGS1);
|
||||
static Term GetDBTerm(DBTerm *, int src CACHE_TYPE);
|
||||
static Term GetDBTerm(const DBTerm *, int src CACHE_TYPE);
|
||||
static DBProp FetchDBPropFromKey(Term, int, int, char *);
|
||||
static Int i_recorded(DBProp, Term CACHE_TYPE);
|
||||
static Int c_recorded(int CACHE_TYPE);
|
||||
@ -267,8 +267,8 @@ static Int co_rded(USES_REGS1);
|
||||
static Int in_rdedp(USES_REGS1);
|
||||
static Int co_rdedp(USES_REGS1);
|
||||
static Int p_first_instance(USES_REGS1);
|
||||
static void ErasePendingRefs(DBTerm *CACHE_TYPE);
|
||||
static void RemoveDBEntry(DBRef CACHE_TYPE);
|
||||
static void ErasePendingRefs(const DBTerm *CACHE_TYPE);
|
||||
static void RemoveDBEntry(const DBRef CACHE_TYPE);
|
||||
static void EraseLogUpdCl(LogUpdClause *);
|
||||
static void MyEraseClause(DynamicClause *CACHE_TYPE);
|
||||
static void PrepareToEraseClause(DynamicClause *, DBRef);
|
||||
@ -292,10 +292,10 @@ static void sf_include(SFKeep *);
|
||||
#endif
|
||||
static Int p_init_queue(USES_REGS1);
|
||||
static Int p_enqueue(USES_REGS1);
|
||||
static void keepdbrefs(DBTerm *CACHE_TYPE);
|
||||
static void keepdbrefs(const DBTerm *ref USES_REGS);
|
||||
static Int p_dequeue(USES_REGS1);
|
||||
static void ErDBE(DBRef CACHE_TYPE);
|
||||
static void ReleaseTermFromDB(DBTerm *CACHE_TYPE);
|
||||
static void ReleaseTermFromDB(const DBTerm *ref USES_REGS);
|
||||
static PredEntry *new_lu_entry(Term);
|
||||
static PredEntry *new_lu_int_key(Int);
|
||||
static PredEntry *find_lu_entry(Term);
|
||||
@ -2519,7 +2519,7 @@ Int Yap_unify_immediate_ref(DBRef ref USES_REGS) {
|
||||
}
|
||||
}
|
||||
|
||||
static Term GetDBTerm(DBTerm *DBSP, int src USES_REGS) {
|
||||
static Term GetDBTerm(const DBTerm *DBSP, int src USES_REGS) {
|
||||
Term t = DBSP->Entry;
|
||||
|
||||
if (IsVarTerm(t)
|
||||
@ -3779,7 +3779,7 @@ static Int p_heap_space_info(USES_REGS1) {
|
||||
* This is called when we are erasing a data base clause, because we may have
|
||||
* pending references
|
||||
*/
|
||||
static void ErasePendingRefs(DBTerm *entryref USES_REGS) {
|
||||
static void ErasePendingRefs(const DBTerm *entryref USES_REGS) {
|
||||
DBRef *cp;
|
||||
DBRef ref;
|
||||
|
||||
@ -4911,21 +4911,21 @@ static Int cont_current_key_integer(USES_REGS1) {
|
||||
return Yap_unify(term, ARG1) && Yap_unify(term, ARG2);
|
||||
}
|
||||
|
||||
Term Yap_FetchTermFromDB(void *ref) {
|
||||
Term Yap_FetchTermFromDB(const void *ref) {
|
||||
CACHE_REGS
|
||||
if (ref == NULL)
|
||||
return 0;
|
||||
return GetDBTerm(ref, FALSE PASS_REGS);
|
||||
}
|
||||
|
||||
Term Yap_FetchClauseTermFromDB(void *ref) {
|
||||
Term Yap_FetchClauseTermFromDB(const void *ref) {
|
||||
CACHE_REGS
|
||||
if (ref == NULL)
|
||||
return 0;
|
||||
return GetDBTerm(ref, TRUE PASS_REGS);
|
||||
}
|
||||
|
||||
Term Yap_PopTermFromDB(void *ref) {
|
||||
Term Yap_PopTermFromDB(const void *ref) {
|
||||
CACHE_REGS
|
||||
|
||||
Term t = GetDBTerm(ref, FALSE PASS_REGS);
|
||||
@ -5141,7 +5141,7 @@ static Int p_enqueue_unlocked(USES_REGS1) {
|
||||
entry itself is still accessible from a trail entry, so we could not remove
|
||||
the target entry,
|
||||
*/
|
||||
static void keepdbrefs(DBTerm *entryref USES_REGS) {
|
||||
static void keepdbrefs (const DBTerm *entryref USES_REGS) {
|
||||
DBRef *cp;
|
||||
DBRef ref;
|
||||
|
||||
@ -5300,7 +5300,7 @@ static Int p_resize_int_keys(USES_REGS1) {
|
||||
return resize_int_keys(IntegerOfTerm(t1));
|
||||
}
|
||||
|
||||
static void ReleaseTermFromDB(DBTerm *ref USES_REGS) {
|
||||
static void ReleaseTermFromDB(const DBTerm *ref USES_REGS) {
|
||||
if (!ref)
|
||||
return;
|
||||
keepdbrefs(ref PASS_REGS);
|
||||
@ -5308,7 +5308,7 @@ static void ReleaseTermFromDB(DBTerm *ref USES_REGS) {
|
||||
FreeDBSpace((char *)ref);
|
||||
}
|
||||
|
||||
void Yap_ReleaseTermFromDB(void *ref) {
|
||||
void Yap_ReleaseTermFromDB(const void *ref) {
|
||||
CACHE_REGS
|
||||
ReleaseTermFromDB(ref PASS_REGS);
|
||||
}
|
||||
|
686
C/errors.c
686
C/errors.c
@ -32,6 +32,125 @@
|
||||
#endif
|
||||
#include "Foreign.h"
|
||||
|
||||
static void print_key_b(const char *key, bool v)
|
||||
{
|
||||
const char *b = v ? "true" : "false";
|
||||
fprintf(stderr,"%s: %s\n", key, b);
|
||||
}
|
||||
|
||||
static void print_key_i(const char *key, YAP_Int v)
|
||||
{
|
||||
fprintf(stderr,"%s: " Int_FORMAT "\n", key, v);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void print_key_s(const char *key, const char *v)
|
||||
{
|
||||
fprintf(stderr,"%s: %s\n", key, v);
|
||||
}
|
||||
|
||||
static void printErr(yap_error_descriptor_t *i) {
|
||||
|
||||
if (i->errorNo == YAP_NO_ERROR) {
|
||||
return;
|
||||
}
|
||||
print_key_i( "errorNo", i->errorNo );
|
||||
print_key_i("errorClass", i->errorClass);
|
||||
print_key_s("errorAsText", i->errorAsText);
|
||||
print_key_s( "errorGoal", i->errorGoal);
|
||||
print_key_s( "classAsText", i->classAsText);
|
||||
print_key_i( "errorLineq", i->errorLine );
|
||||
print_key_s( "errorFunction", i->errorFunction);
|
||||
print_key_s( "errorFile", i->errorFile);
|
||||
print_key_i( "prologPredLine", i->prologPredLine);
|
||||
print_key_i( "prologPredFirstLine", i->prologPredFirstLine);
|
||||
print_key_i( "prologPredLastLine", i->prologPredLastLine);
|
||||
print_key_s( "prologPredName", i->prologPredName);
|
||||
print_key_i( "prologPredArity", i->prologPredArity);
|
||||
print_key_s( "prologPredModule", i->prologPredModule);
|
||||
print_key_s( "prologPredFile", i->prologPredFile);
|
||||
print_key_i( "prologParserPos", i->prologParserPos);
|
||||
print_key_i( "prologParserLine", i->prologParserLine);
|
||||
print_key_i( "prologParserFirstLine", i->prologParserFirstLine);
|
||||
print_key_i( "prologParserLastLine", i->prologParserLastLine);
|
||||
print_key_s( "prologParserText", i->prologParserText);
|
||||
print_key_s( "prologParserFile", i->prologParserFile);
|
||||
print_key_b( "prologConsulting", i->prologConsulting);
|
||||
print_key_s( "culprit", i->culprit);
|
||||
if (i->errorMsgLen) {
|
||||
print_key_s( "errorMsg", i->errorMsg);
|
||||
print_key_i( "errorMsgLen", i->errorMsgLen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static YAP_Term add_key_b(const char *key, bool v, YAP_Term o0)
|
||||
{
|
||||
YAP_Term tkv[2];
|
||||
tkv[1] = v ? TermTrue : TermFalse;
|
||||
tkv[0] = MkStringTerm(key);
|
||||
Term node = Yap_MkApplTerm( FunctorEq, 2, tkv);
|
||||
return MkPairTerm(node, o0);
|
||||
}
|
||||
|
||||
static YAP_Term add_key_i(const char *key, YAP_Int v, YAP_Term o0)
|
||||
{
|
||||
YAP_Term tkv[2];
|
||||
tkv[1] = MkIntegerTerm(v), tkv[0] = MkStringTerm(key);
|
||||
Term node = Yap_MkApplTerm( FunctorEq, 2, tkv);
|
||||
return MkPairTerm(node, o0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static YAP_Term add_key_s(const char *key, const char *v, YAP_Term o0)
|
||||
{
|
||||
Term tkv[2];
|
||||
if (!v || v[0] == '\n')
|
||||
return o0;
|
||||
tkv[1] = MkStringTerm(v), tkv[0] = MkStringTerm(key);
|
||||
Term node = Yap_MkApplTerm( FunctorEq, 2, tkv);
|
||||
return MkPairTerm(node, o0);
|
||||
}
|
||||
|
||||
static Term err2list(yap_error_descriptor_t *i) {
|
||||
Term o = TermNil;
|
||||
if (i->errorNo == YAP_NO_ERROR) {
|
||||
return o;
|
||||
}
|
||||
o = add_key_i( "errorNo", i->errorNo, o );
|
||||
o = add_key_i("errorClass", i->errorClass, o);
|
||||
o = add_key_s("errorAsText", i->errorAsText, o);
|
||||
o = add_key_s( "errorGoal", i->errorGoal, o);
|
||||
o = add_key_s( "classAsText", i->classAsText, o);
|
||||
o = add_key_i( "errorLineq", i->errorLine, o );
|
||||
o = add_key_s( "errorFunction", i->errorFunction, o);
|
||||
o = add_key_s( "errorFile", i->errorFile, o);
|
||||
o = add_key_i( "prologPredLine", i->prologPredLine, o);
|
||||
o = add_key_i( "prologPredFirstLine", i->prologPredFirstLine, o);
|
||||
o = add_key_i( "prologPredLastLine", i->prologPredLastLine, o);
|
||||
o = add_key_s( "prologPredName", i->prologPredName, o);
|
||||
o = add_key_i( "prologPredArity", i->prologPredArity, o);
|
||||
o = add_key_s( "prologPredModule", i->prologPredModule, o);
|
||||
o = add_key_s( "prologPredFile", i->prologPredFile, o);
|
||||
o = add_key_i( "prologParserPos", i->prologParserPos, o);
|
||||
o = add_key_i( "prologParserLine", i->prologParserLine, o);
|
||||
o = add_key_i( "prologParserFirstLine", i->prologParserFirstLine, o);
|
||||
o = add_key_i( "prologParserLastLine", i->prologParserLastLine, o);
|
||||
o = add_key_s( "prologParserText", i->prologParserText, o);
|
||||
o = add_key_s( "prologParserFile", i->prologParserFile, o);
|
||||
o = add_key_b( "prologConsulting", i->prologConsulting, o);
|
||||
o = add_key_s( "culprit", i->culprit, o);
|
||||
if (i->errorMsgLen) {
|
||||
o = add_key_s( "errorMsg", i->errorMsg, o);
|
||||
o = add_key_i( "errorMsgLen", i->errorMsgLen, o);
|
||||
}
|
||||
return o;
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool Yap_Warning(const char *s, ...) {
|
||||
CACHE_REGS
|
||||
va_list ap;
|
||||
@ -92,7 +211,7 @@ void Yap_InitError__(const char *file, const char *function, int lineno, yap_err
|
||||
} else
|
||||
return;
|
||||
va_end(ap);
|
||||
if (LOCAL_ActiveError->status) {
|
||||
if (LOCAL_ActiveError->errorNo != YAP_NO_ERROR) {
|
||||
Yap_exit(1);
|
||||
}
|
||||
LOCAL_ActiveError->errorNo = e;
|
||||
@ -232,7 +351,7 @@ int Yap_SWIHandleError(const char *s, ...) {
|
||||
|
||||
void Yap_RestartYap(int flag) {
|
||||
CACHE_REGS
|
||||
fprintf(stderr,"HR=%p\n", HR);
|
||||
fprintf(stderr,"call siglongjmp HR=%p\n", HR);
|
||||
#if PUSH_REGS
|
||||
restore_absmi_regs(&Yap_standard_regs);
|
||||
#endif
|
||||
@ -283,47 +402,54 @@ static char tmpbuf[YAP_BUF_SIZE];
|
||||
#undef E2
|
||||
#undef END_ERRORS
|
||||
|
||||
#define BEGIN_ERROR_CLASSES() \
|
||||
static Term mkerrorct(yap_error_class_number c, Term *ts) { \
|
||||
switch (c) {
|
||||
#define BEGIN_ERROR_CLASSES() \
|
||||
static Atom mkerrorct(yap_error_class_number c) { \
|
||||
switch (c) {
|
||||
|
||||
#define ECLASS(CL, A, B) \
|
||||
case CL: \
|
||||
if (A == 0) \
|
||||
return MkAtomTerm(Yap_LookupAtom(A)); \
|
||||
else { \
|
||||
return Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom(A), B), B, ts); \
|
||||
}
|
||||
#define ECLASS(CL, A, B) \
|
||||
case CL: \
|
||||
return Yap_LookupAtom(A); \
|
||||
|
||||
#define END_ERROR_CLASSES() \
|
||||
} \
|
||||
return TermNil; \
|
||||
#define END_ERROR_CLASSES() \
|
||||
} \
|
||||
return NULL; \
|
||||
}
|
||||
|
||||
#define BEGIN_ERRORS() \
|
||||
static Term mkerrort(yap_error_number e, Term *ts) { \
|
||||
switch (e) {
|
||||
#define BEGIN_ERRORS() \
|
||||
static Term mkerrort(yap_error_number e, Term culprit, Term info) { \
|
||||
switch (e) {
|
||||
|
||||
#define E0(A, B) \
|
||||
case A: \
|
||||
return mkerrorct(B, ts);
|
||||
#define E0(A, B) \
|
||||
case A: { \
|
||||
Term ft[2]; \
|
||||
ft[0] = MkAtomTerm(mkerrorct(A)); \
|
||||
ft[1] = info; \
|
||||
return Yap_MkApplTerm(FunctorError,2,ft); }
|
||||
|
||||
#define E(A, B, C) \
|
||||
case A: \
|
||||
ts -= 1; \
|
||||
ts[0] = MkAtomTerm(Yap_LookupAtom(C)); \
|
||||
return mkerrorct(B, ts);
|
||||
#define E(A, B, C) \
|
||||
case A: \
|
||||
{ Term ft[2], nt[2]; \
|
||||
ft[0] = Yap_MkNewApplTerm(Yap_MkFunctor(mkerrorct(B),2), 2); \
|
||||
nt[1] = MkAtomTerm(Yap_LookupAtom(C)); \
|
||||
RESET_VARIABLE(nt+2); Yap_unify(nt[2], culprit); \
|
||||
ft[1] = info; \
|
||||
return Yap_MkApplTerm(FunctorError,2,ft); }
|
||||
|
||||
#define E2(A, B, C, D) \
|
||||
case A: \
|
||||
ts -= 2; \
|
||||
ts[0] = MkAtomTerm(Yap_LookupAtom(C)); \
|
||||
ts[1] = MkAtomTerm(Yap_LookupAtom(D)); \
|
||||
return mkerrorct(B, ts);
|
||||
#define E2(A, B, C, D) \
|
||||
case A: \
|
||||
{ \
|
||||
Term ft[3], nt[2]; \
|
||||
ft[0] = Yap_MkNewApplTerm(Yap_MkFunctor(mkerrorct(B),3), 3); \
|
||||
nt[1] = MkAtomTerm(Yap_LookupAtom(C)); \
|
||||
nt[2] = MkAtomTerm(Yap_LookupAtom(D)); \
|
||||
RESET_VARIABLE(nt+3); Yap_unify(nt[3], culprit); \
|
||||
ft[1] = info; \
|
||||
return Yap_MkApplTerm(FunctorError,2,ft); \
|
||||
}
|
||||
|
||||
#define END_ERRORS() \
|
||||
} \
|
||||
return TermNil; \
|
||||
#define END_ERRORS() \
|
||||
} \
|
||||
return TermNil; \
|
||||
}
|
||||
|
||||
#include "YapErrors.h"
|
||||
@ -334,14 +460,16 @@ void Yap_pushErrorContext(yap_error_descriptor_t *new_error) {
|
||||
LOCAL_ActiveError = new_error;
|
||||
}
|
||||
|
||||
static void
|
||||
reset_error_description(void) {
|
||||
yap_error_descriptor_t *bf = LOCAL_ActiveError->top_error;
|
||||
if (Yap_HasException())
|
||||
memset(LOCAL_ActiveError, 0, sizeof(*LOCAL_ActiveError));
|
||||
LOCAL_ActiveError->top_error = bf;
|
||||
/* static void */
|
||||
/* reset_error_description(void) { */
|
||||
/* yap_error_descriptor_t *bf = LOCAL_ActiveError->top_error; */
|
||||
/* if (Yap_HasException()) */
|
||||
/* memset(LOCAL_ActiveError, 0, sizeof(*LOCAL_ActiveError)); */
|
||||
/* LOCAL_ActiveError->top_error = bf; */
|
||||
|
||||
/* } */
|
||||
|
||||
|
||||
}
|
||||
|
||||
yap_error_descriptor_t *Yap_popErrorContext(bool pass) {
|
||||
if (pass && LOCAL_ActiveError->top_error->errorNo == YAP_NO_ERROR &&
|
||||
@ -373,9 +501,8 @@ void Yap_ThrowError__(const char *file, const char *function, int lineno,
|
||||
}
|
||||
if (LOCAL_RestartEnv) {
|
||||
Yap_RestartYap(5);
|
||||
} else {
|
||||
exit(5);
|
||||
}
|
||||
Yap_exit(5);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -413,268 +540,214 @@ void Yap_ThrowError__(const char *file, const char *function, int lineno,
|
||||
*/
|
||||
yamop *Yap_Error__(bool throw, const char *file, const char *function, int lineno,
|
||||
yap_error_number type, Term where, ...) {
|
||||
CACHE_REGS
|
||||
va_list ap;
|
||||
CELL nt[3];
|
||||
Functor fun;
|
||||
Term error_t;
|
||||
Term comment;
|
||||
char *fmt;
|
||||
char s[MAXPATHLEN];
|
||||
CACHE_REGS
|
||||
va_list ap;
|
||||
char *fmt;
|
||||
char s[MAXPATHLEN];
|
||||
|
||||
/* disallow recursive error handling */
|
||||
if (LOCAL_PrologMode & InErrorMode) {
|
||||
fprintf(stderr, "%% ERROR WITHIN ERROR %d: %s\n", LOCAL_Error_TYPE, tmpbuf);
|
||||
Yap_RestartYap(1);
|
||||
}
|
||||
if (LOCAL_DoingUndefp && type == EVALUATION_ERROR_UNDEFINED) {
|
||||
P = FAILCODE;
|
||||
CalculateStackGap(PASS_REGS1);
|
||||
return P;
|
||||
}
|
||||
LOCAL_ActiveError->errorNo = type;
|
||||
LOCAL_ActiveError->errorAsText = Yap_errorName(type);
|
||||
LOCAL_ActiveError->errorClass = Yap_errorClass(type);
|
||||
LOCAL_ActiveError->classAsText =
|
||||
Yap_errorClassName(LOCAL_ActiveError->errorClass);
|
||||
LOCAL_ActiveError->errorLine = lineno;
|
||||
LOCAL_ActiveError->errorFunction = function;
|
||||
LOCAL_ActiveError->errorFile = file;
|
||||
Yap_find_prolog_culprit(PASS_REGS1);
|
||||
LOCAL_PrologMode |= InErrorMode;
|
||||
Yap_ClearExs();
|
||||
if (where == 0L) {
|
||||
where = TermNil;
|
||||
}
|
||||
// first, obtain current location
|
||||
// sprintf(LOCAL_FileNameBuf, "%s:%d in C-function %s ", file, lineno,
|
||||
// function);
|
||||
// tf = MkAtomTerm(Yap_LookupAtom(LOCAL_FileNameBuf));
|
||||
#if DEBUG_STRICT
|
||||
if (Yap_heap_regs && !(LOCAL_PrologMode & BootMode))
|
||||
fprintf(stderr, "***** Processing Error %d (%lx,%x) %s***\n", type,
|
||||
(unsigned long int)LOCAL_Signals, LOCAL_PrologMode, fmt);
|
||||
else
|
||||
fprintf(stderr, "***** Processing Error %d (%x) %s***\n", type,
|
||||
LOCAL_PrologMode, fmt);
|
||||
#endif
|
||||
if (type == INTERRUPT_EVENT) {
|
||||
fprintf(stderr, "%% YAP exiting: cannot handle signal %d\n",
|
||||
(int)IntOfTerm(where));
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
Yap_exit(1);
|
||||
}
|
||||
if (LOCAL_within_print_message) {
|
||||
/* error within error */
|
||||
fprintf(stderr, "%% ERROR WITHIN WARNING %d: %s\n", LOCAL_Error_TYPE,
|
||||
tmpbuf);
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
Yap_exit(1);
|
||||
}
|
||||
va_start(ap, where);
|
||||
fmt = va_arg(ap, char *);
|
||||
if (fmt != NULL) {
|
||||
#if HAVE_VSNPRINTF
|
||||
(void)vsnprintf(s, MAXPATHLEN - 1, fmt, ap);
|
||||
#else
|
||||
(void)vsprintf(s, fmt, ap);
|
||||
#endif
|
||||
// fprintf(stderr, "warning: ");
|
||||
comment = MkAtomTerm(Yap_LookupAtom(s));
|
||||
} else if (LOCAL_ErrorMessage && LOCAL_ErrorMessage[0]) {
|
||||
comment = MkAtomTerm(Yap_LookupAtom(LOCAL_ErrorMessage));
|
||||
} else {
|
||||
comment = TermNil;
|
||||
}
|
||||
va_end(ap);
|
||||
if (P == (yamop *)(FAILCODE)) {
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return P;
|
||||
}
|
||||
/* PURE_ABORT may not have set where correctly, BootMode may not have the data
|
||||
* terms ready */
|
||||
if (type == ABORT_EVENT || LOCAL_PrologMode & BootMode) {
|
||||
where = TermNil;
|
||||
LOCAL_PrologMode &= ~AbortMode;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
/* make sure failure will be seen at next port */
|
||||
// no need to lock & unlock
|
||||
if (LOCAL_PrologMode & AsyncIntMode)
|
||||
Yap_signal(YAP_FAIL_SIGNAL);
|
||||
P = FAILCODE;
|
||||
} else {
|
||||
if (IsVarTerm(where)) {
|
||||
/* we must be careful someone gave us a copy to a local variable */
|
||||
Term t = MkVarTerm();
|
||||
Yap_unify(t, where);
|
||||
where = Deref(where);
|
||||
/* disallow recursive error handling */
|
||||
if (LOCAL_PrologMode & InErrorMode) {
|
||||
fprintf(stderr, "%% ERROR WITHIN ERROR %d: %s\n", LOCAL_Error_TYPE, tmpbuf);
|
||||
Yap_RestartYap(1);
|
||||
}
|
||||
/* Exit Abort Mode, if we were there */
|
||||
LOCAL_PrologMode &= ~AbortMode;
|
||||
if (LOCAL_DoingUndefp && type == EVALUATION_ERROR_UNDEFINED) {
|
||||
P = FAILCODE;
|
||||
CalculateStackGap(PASS_REGS1);
|
||||
return P;
|
||||
}
|
||||
LOCAL_ActiveError->errorNo = type;
|
||||
LOCAL_ActiveError->errorAsText = Yap_errorName(type);
|
||||
LOCAL_ActiveError->errorClass = Yap_errorClass(type);
|
||||
LOCAL_ActiveError->classAsText =
|
||||
Yap_errorClassName(LOCAL_ActiveError->errorClass);
|
||||
LOCAL_ActiveError->errorLine = lineno;
|
||||
LOCAL_ActiveError->errorFunction = function;
|
||||
LOCAL_ActiveError->errorFile = file;
|
||||
Yap_prolog_add_culprit(LOCAL_ActiveError PASS_REGS1);
|
||||
LOCAL_PrologMode |= InErrorMode;
|
||||
if (!(where = Yap_CopyTerm(where))) {
|
||||
where = TermNil;
|
||||
}
|
||||
}
|
||||
|
||||
if (LOCAL_PrologMode & BootMode) {
|
||||
/* crash in flames! */
|
||||
fprintf(stderr,
|
||||
"%s:%d:0 YAP Fatal Error %d in function %s:\n %s exiting....\n",
|
||||
file, lineno, type, function, s);
|
||||
error_exit_yap(1);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
// DumpActiveGoals( USES_REGS1 );
|
||||
#endif /* DEBUG */
|
||||
if (!IsVarTerm(where) && IsApplTerm(where) &&
|
||||
FunctorOfTerm(where) == FunctorError) {
|
||||
error_t = where;
|
||||
P = (yamop *)FAILCODE;
|
||||
Yap_JumpToEnv(error_t);
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return P;
|
||||
}
|
||||
switch (type) {
|
||||
case SYSTEM_ERROR_INTERNAL: {
|
||||
fprintf(stderr, "%% Internal YAP Error: %s exiting....\n", tmpbuf);
|
||||
// serious = true;
|
||||
if (LOCAL_PrologMode & BootMode) {
|
||||
fprintf(stderr, "%% YAP crashed while booting %s\n", tmpbuf);
|
||||
} else {
|
||||
Yap_detect_bug_location(P, FIND_PRED_FROM_ANYWHERE, YAP_BUF_SIZE);
|
||||
if (tmpbuf[0]) {
|
||||
fprintf(stderr, "%% Bug found while executing %s\n", tmpbuf);
|
||||
}
|
||||
#if HAVE_BACKTRACE
|
||||
void *callstack[256];
|
||||
int i;
|
||||
int frames = backtrace(callstack, 256);
|
||||
char **strs = backtrace_symbols(callstack, frames);
|
||||
fprintf(stderr, "Execution stack:\n");
|
||||
for (i = 0; i < frames; ++i) {
|
||||
fprintf(stderr, " %s\n", strs[i]);
|
||||
}
|
||||
free(strs);
|
||||
Yap_ClearExs();
|
||||
// first, obtain current location
|
||||
// sprintf(LOCAL_FileNameBuf, "%s:%d in C-function %s ", file, lineno,
|
||||
// function);
|
||||
// tf = MkAtomTerm(Yap_LookupAtom(LOCAL_FileNameBuf));
|
||||
#if DEBUG_STRICT
|
||||
if (Yap_heap_regs && !(LOCAL_PrologMode & BootMode))
|
||||
fprintf(stderr, "***** Processing Error %d (%lx,%x) %s***\n", type,
|
||||
(unsigned long int)LOCAL_Signals, LOCAL_PrologMode, fmt);
|
||||
else
|
||||
fprintf(stderr, "***** Processing Error %d (%x) %s***\n", type,
|
||||
LOCAL_PrologMode, fmt);
|
||||
#endif
|
||||
if (type == INTERRUPT_EVENT) {
|
||||
fprintf(stderr, "%% YAP exiting: cannot handle signal %d\n",
|
||||
(int) IntOfTerm(where));
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
Yap_exit(1);
|
||||
}
|
||||
error_exit_yap(1);
|
||||
}
|
||||
case SYSTEM_ERROR_FATAL: {
|
||||
fprintf(stderr, "%% Fatal YAP Error: %s exiting....\n", tmpbuf);
|
||||
error_exit_yap(1);
|
||||
}
|
||||
case INTERRUPT_EVENT: {
|
||||
error_exit_yap(1);
|
||||
}
|
||||
case ABORT_EVENT:
|
||||
nt[0] = MkAtomTerm(AtomDAbort);
|
||||
fun = FunctorDollarVar;
|
||||
// serious = true;
|
||||
break;
|
||||
case CALL_COUNTER_UNDERFLOW_EVENT:
|
||||
/* Do a long jump */
|
||||
LOCAL_ReductionsCounterOn = FALSE;
|
||||
LOCAL_PredEntriesCounterOn = FALSE;
|
||||
LOCAL_RetriesCounterOn = FALSE;
|
||||
Yap_JumpToEnv(MkAtomTerm(AtomCallCounter));
|
||||
P = FAILCODE;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return (P);
|
||||
case PRED_ENTRY_COUNTER_UNDERFLOW_EVENT:
|
||||
/* Do a long jump */
|
||||
LOCAL_ReductionsCounterOn = FALSE;
|
||||
LOCAL_PredEntriesCounterOn = FALSE;
|
||||
LOCAL_RetriesCounterOn = FALSE;
|
||||
Yap_JumpToEnv(MkAtomTerm(AtomCallAndRetryCounter));
|
||||
P = FAILCODE;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return (P);
|
||||
case RETRY_COUNTER_UNDERFLOW_EVENT:
|
||||
/* Do a long jump */
|
||||
LOCAL_ReductionsCounterOn = FALSE;
|
||||
LOCAL_PredEntriesCounterOn = FALSE;
|
||||
LOCAL_RetriesCounterOn = FALSE;
|
||||
Yap_JumpToEnv(MkAtomTerm(AtomRetryCounter));
|
||||
P = (yamop *)FAILCODE;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return (P);
|
||||
default: {
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
Term ts[3];
|
||||
ts[2] = where;
|
||||
nt[0] = mkerrort(type, ts + 2);
|
||||
}
|
||||
}
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
if (type != ABORT_EVENT) {
|
||||
Term location;
|
||||
|
||||
/* This is used by some complex procedures to detect there was an error */
|
||||
if (IsAtomTerm(nt[0])) {
|
||||
LOCAL_ErrorMessage = RepAtom(AtomOfTerm(nt[0]))->StrOfAE;
|
||||
if (LOCAL_within_print_message) {
|
||||
/* error within error */
|
||||
fprintf(stderr, "%% ERROR WITHIN WARNING %d: %s\n", LOCAL_Error_TYPE,
|
||||
tmpbuf);
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
Yap_exit(1);
|
||||
}
|
||||
if (where == 0L || where == TermNil) {
|
||||
LOCAL_ActiveError->culprit = NULL;
|
||||
} else {
|
||||
LOCAL_ErrorMessage =
|
||||
(char *)RepAtom(NameOfFunctor(FunctorOfTerm(nt[0])))->StrOfAE;
|
||||
LOCAL_ActiveError->culprit = Yap_TermToBuffer(where, LOCAL_encoding, Quote_illegal_f | Handle_vars_f);
|
||||
|
||||
}
|
||||
nt[1] = TermNil;
|
||||
va_start(ap, where);
|
||||
fmt = va_arg(ap, char *);
|
||||
if (fmt != NULL) {
|
||||
#if HAVE_VSNPRINTF
|
||||
(void) vsnprintf(s, MAXPATHLEN - 1, fmt, ap);
|
||||
#else
|
||||
(void)vsprintf(s, fmt, ap);
|
||||
#endif
|
||||
// fprintf(stderr, "warning: ");
|
||||
if (s[0]) {
|
||||
LOCAL_ActiveError->errorMsgLen = strlen(s) + 1;
|
||||
LOCAL_ActiveError->errorMsg = malloc(LOCAL_ActiveError->errorMsgLen);
|
||||
strcpy(LOCAL_ActiveError->errorMsg, s);
|
||||
} else if (LOCAL_ErrorMessage && LOCAL_ErrorMessage[0]) {
|
||||
LOCAL_ActiveError->errorMsgLen = strlen(LOCAL_ErrorMessage) + 1;
|
||||
LOCAL_ActiveError->errorMsg = malloc(LOCAL_ActiveError->errorMsgLen);
|
||||
strcpy(LOCAL_ActiveError->errorMsg, LOCAL_ErrorMessage);
|
||||
} else {
|
||||
LOCAL_ActiveError->errorMsgLen = 0;
|
||||
LOCAL_ActiveError->errorMsg = 0;
|
||||
}
|
||||
}
|
||||
va_end(ap);
|
||||
if (where == 0 || where == TermNil) {
|
||||
LOCAL_ActiveError->culprit = 0;
|
||||
}
|
||||
if (P == (yamop *) (FAILCODE)) {
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return P;
|
||||
}
|
||||
/* PURE_ABORT may not have set where correctly, BootMode may not have the data
|
||||
* terms ready */
|
||||
if (type == ABORT_EVENT || LOCAL_PrologMode & BootMode) {
|
||||
LOCAL_PrologMode &= ~AbortMode;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
/* make sure failure will be seen at next port */
|
||||
// no need to lock & unlock
|
||||
if (LOCAL_PrologMode & AsyncIntMode)
|
||||
Yap_signal(YAP_FAIL_SIGNAL);
|
||||
P = FAILCODE;
|
||||
} else {
|
||||
/* Exit Abort Mode, if we were there */
|
||||
LOCAL_PrologMode &= ~AbortMode;
|
||||
LOCAL_PrologMode |= InErrorMode;
|
||||
}
|
||||
|
||||
if (LOCAL_PrologMode & BootMode) {
|
||||
/* crash in flames! */
|
||||
fprintf(stderr,
|
||||
"%s:%d:0 YAP Fatal Error %d in function %s:\n %s exiting....\n",
|
||||
file, lineno, type, function, s);
|
||||
error_exit_yap(1);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
// DumpActiveGoals( USES_REGS1 );
|
||||
#endif /* DEBUG */
|
||||
|
||||
switch (type) {
|
||||
case RESOURCE_ERROR_HEAP:
|
||||
case RESOURCE_ERROR_STACK:
|
||||
case RESOURCE_ERROR_TRAIL:
|
||||
comment = MkAtomTerm(Yap_LookupAtom(tmpbuf));
|
||||
default:
|
||||
if (comment != TermNil)
|
||||
nt[1] = MkPairTerm(MkPairTerm(MkAtomTerm(Yap_LookupAtom("i")), comment),
|
||||
nt[1]);
|
||||
if (file && function) {
|
||||
Term ts[3], t3;
|
||||
ts[0] = MkAtomTerm(Yap_LookupAtom(file));
|
||||
ts[1] = MkIntegerTerm(lineno);
|
||||
ts[2] = MkAtomTerm(Yap_LookupAtom(function));
|
||||
t3 = Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("c"), 3), 3, ts);
|
||||
nt[1] =
|
||||
MkPairTerm(MkPairTerm(MkAtomTerm(Yap_LookupAtom("c")), t3), nt[1]);
|
||||
}
|
||||
if ((location = Yap_pc_location(P, B, ENV)) != TermNil) {
|
||||
nt[1] = MkPairTerm(
|
||||
MkPairTerm(MkAtomTerm(Yap_LookupAtom("p")), location), nt[1]);
|
||||
}
|
||||
if ((location = Yap_env_location(CP, B, ENV, 0)) != TermNil) {
|
||||
nt[1] = MkPairTerm(
|
||||
MkPairTerm(MkAtomTerm(Yap_LookupAtom("e")), location), nt[1]);
|
||||
}
|
||||
case SYSTEM_ERROR_INTERNAL: {
|
||||
fprintf(stderr, "%% Internal YAP Error: %s exiting....\n", tmpbuf);
|
||||
// serious = true;
|
||||
if (LOCAL_PrologMode & BootMode) {
|
||||
fprintf(stderr, "%% YAP crashed while booting %s\n", tmpbuf);
|
||||
} else {
|
||||
Yap_detect_bug_location(P, FIND_PRED_FROM_ANYWHERE, YAP_BUF_SIZE);
|
||||
if (tmpbuf[0]) {
|
||||
fprintf(stderr, "%% Bug found while executing %s\n", tmpbuf);
|
||||
}
|
||||
#if HAVE_BACKTRACE
|
||||
void *callstack[256];
|
||||
int i;
|
||||
int frames = backtrace(callstack, 256);
|
||||
char **strs = backtrace_symbols(callstack, frames);
|
||||
fprintf(stderr, "Execution stack:\n");
|
||||
for (i = 0; i < frames; ++i) {
|
||||
fprintf(stderr, " %s\n", strs[i]);
|
||||
}
|
||||
free(strs);
|
||||
#endif
|
||||
}
|
||||
error_exit_yap(1);
|
||||
}
|
||||
case SYSTEM_ERROR_FATAL: {
|
||||
fprintf(stderr, "%% Fatal YAP Error: %s exiting....\n", tmpbuf);
|
||||
error_exit_yap(1);
|
||||
}
|
||||
case INTERRUPT_EVENT: {
|
||||
error_exit_yap(1);
|
||||
}
|
||||
case ABORT_EVENT:
|
||||
// fun = FunctorDollarVar;
|
||||
// serious = true;
|
||||
LOCAL_ActiveError->errorNo = ABORT_EVENT;
|
||||
Yap_JumpToEnv();
|
||||
P = FAILCODE;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return P;
|
||||
case CALL_COUNTER_UNDERFLOW_EVENT:
|
||||
/* Do a long jump */
|
||||
LOCAL_ReductionsCounterOn = FALSE;
|
||||
LOCAL_PredEntriesCounterOn = FALSE;
|
||||
LOCAL_RetriesCounterOn = FALSE;
|
||||
LOCAL_ActiveError->errorNo = CALL_COUNTER_UNDERFLOW_EVENT;
|
||||
Yap_JumpToEnv();
|
||||
P = FAILCODE;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return P;
|
||||
case PRED_ENTRY_COUNTER_UNDERFLOW_EVENT:
|
||||
/* Do a long jump */
|
||||
LOCAL_ReductionsCounterOn = FALSE;
|
||||
LOCAL_PredEntriesCounterOn = FALSE;
|
||||
LOCAL_RetriesCounterOn = FALSE;
|
||||
LOCAL_ActiveError->errorNo = PRED_ENTRY_COUNTER_UNDERFLOW_EVENT;
|
||||
Yap_JumpToEnv();
|
||||
P = FAILCODE;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return P;
|
||||
case RETRY_COUNTER_UNDERFLOW_EVENT:
|
||||
/* Do a long jump */
|
||||
LOCAL_ReductionsCounterOn = FALSE;
|
||||
LOCAL_PredEntriesCounterOn = FALSE;
|
||||
LOCAL_RetriesCounterOn = FALSE;
|
||||
LOCAL_ActiveError->errorNo = RETRY_COUNTER_UNDERFLOW_EVENT;
|
||||
Yap_JumpToEnv();
|
||||
P = FAILCODE;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return P;
|
||||
default:
|
||||
if (!Yap_pc_add_location(LOCAL_ActiveError, CP, B, ENV))
|
||||
Yap_env_add_location(LOCAL_ActiveError, CP, B, ENV, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* disable active signals at this point */
|
||||
LOCAL_Signals = 0;
|
||||
LOCAL_Signals = 0;
|
||||
CalculateStackGap(PASS_REGS1);
|
||||
#if DEBUG
|
||||
// DumpActiveGoals( PASS_REGS1 );
|
||||
#endif
|
||||
/* wait if we we are in user code,
|
||||
it's up to her to decide */
|
||||
fun = FunctorError;
|
||||
error_t = Yap_MkApplTerm(fun, 2, nt);
|
||||
|
||||
if (type == ABORT_EVENT) {
|
||||
error_t = MkAtomTerm(AtomDAbort);
|
||||
} else {
|
||||
error_t = Yap_MkApplTerm(fun, 2, nt);
|
||||
}
|
||||
if (LOCAL_DoingUndefp) {
|
||||
Yap_PrintWarning(error_t);
|
||||
Yap_PrintWarning(Yap_GetException());
|
||||
return P;
|
||||
}
|
||||
//reset_error_description();
|
||||
Yap_PutException(error_t);
|
||||
fprintf(stderr,"HR before jmp=%p\n", HR);
|
||||
if (throw)
|
||||
LOCAL_BallTerm = Yap_StoreTermInDB(error_t, 5);
|
||||
else
|
||||
Yap_JumpToEnv(error_t);
|
||||
fprintf(stderr,"HR after jmp=%p\n", HR);
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
if (!throw) {
|
||||
Yap_JumpToEnv();
|
||||
}
|
||||
return P;
|
||||
}
|
||||
|
||||
@ -835,8 +908,53 @@ const char *Yap_errorClassName(yap_error_class_number e) {
|
||||
return c_error_class_name[e];
|
||||
}
|
||||
|
||||
Term Yap_GetException(void) {
|
||||
CACHE_REGS
|
||||
if (LOCAL_ActiveError->errorNo != YAP_NO_ERROR) {
|
||||
yap_error_descriptor_t *t = LOCAL_ActiveError;
|
||||
Term rc = mkerrort(t->errorNo, Yap_BufferToTerm(t->culprit, TermNil), err2list(t));
|
||||
Yap_DebugPlWriteln(rc);
|
||||
Yap_ResetException(worker_id);
|
||||
return rc;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Yap_PrintException(void) {
|
||||
printErr(LOCAL_ActiveError);
|
||||
}
|
||||
|
||||
bool Yap_RaiseException(void) {
|
||||
if (LOCAL_ActiveError->errorNo == YAP_NO_ERROR)
|
||||
return false;
|
||||
return Yap_JumpToEnv();
|
||||
}
|
||||
|
||||
bool Yap_ResetException(int wid) {
|
||||
// reset error descriptor
|
||||
yap_error_descriptor_t *bf = REMOTE_ActiveError(wid)->top_error;
|
||||
memset(REMOTE_ActiveError(wid), 0, sizeof(*LOCAL_ActiveError));
|
||||
REMOTE_ActiveError(wid)->top_error = bf;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return true;
|
||||
}
|
||||
|
||||
static Int reset_exception(USES_REGS1) { return Yap_ResetException(worker_id); }
|
||||
|
||||
|
||||
static Int get_exception(USES_REGS1) {
|
||||
Term t;
|
||||
if (Yap_HasException() && (t = Yap_GetException()) != 0) {
|
||||
Int rc= Yap_unify(t, ARG1);
|
||||
return rc;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Yap_InitErrorPreds(void) {
|
||||
CACHE_REGS
|
||||
Yap_InitCPred("$reset_exception", 1, reset_exception, 0);
|
||||
Yap_InitCPred("$get_exception", 1, get_exception, 0);
|
||||
Yap_InitCPred("$close_error", 0, close_error, HiddenPredFlag);
|
||||
Yap_InitCPred("is_boolean", 2, is_boolean, TestPredFlag);
|
||||
Yap_InitCPred("is_callable", 2, is_callable, TestPredFlag);
|
||||
|
84
C/exec.c
84
C/exec.c
@ -834,7 +834,7 @@ static bool watch_cut(Term ext USES_REGS) {
|
||||
CELL *complete_pt = deref_ptr(RepAppl(task) + 4);
|
||||
complete_pt[0] = TermTrue;
|
||||
if (ex_mode) {
|
||||
Yap_PutException(e);
|
||||
//Yap_PutException(e);
|
||||
return true;
|
||||
}
|
||||
if (Yap_RaiseException())
|
||||
@ -893,7 +893,7 @@ static bool watch_retry(Term d0 USES_REGS) {
|
||||
port_pt[0] = t;
|
||||
Yap_ignore(cleanup, true);
|
||||
if (ex_mode) {
|
||||
Yap_PutException(e);
|
||||
//Yap_PutException(e);
|
||||
return true;
|
||||
}
|
||||
if (Yap_RaiseException())
|
||||
@ -1436,7 +1436,8 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
|
||||
/* can be called from anywhere, must reset registers,
|
||||
*/
|
||||
while (B) {
|
||||
Yap_JumpToEnv(TermDAbort);
|
||||
LOCAL_ActiveError->errorNo = ABORT_EVENT;
|
||||
Yap_JumpToEnv();
|
||||
}
|
||||
LOCAL_PrologMode &= ~AbortMode;
|
||||
P = (yamop *) FAILCODE;
|
||||
@ -1449,7 +1450,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
|
||||
|
||||
Yap_regp = old_rs;
|
||||
fprintf(stderr,"HR before jmp=%p\n", HR);
|
||||
Yap_JumpToEnv(0);
|
||||
Yap_JumpToEnv();
|
||||
fprintf(stderr,"HR after jmp=%p\n", HR);
|
||||
LOCAL_PrologMode = UserMode;
|
||||
ASP = (CELL *) B;
|
||||
@ -1468,7 +1469,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
|
||||
YENV = ASP;
|
||||
YENV[E_CB] = Unsigned(B);
|
||||
out = Yap_absmi(0);
|
||||
fprintf(stderr, "HR after absmi=%p\n", HR);
|
||||
// fprintf(stderr, "HR after absmi=%p\n", HR);
|
||||
/* make sure we don't leave a FAIL signal hanging around */
|
||||
Yap_get_signal(YAP_FAIL_SIGNAL);
|
||||
if (!Yap_has_a_signal())
|
||||
@ -2017,7 +2018,7 @@ bool is_cleanup_cp(choiceptr cp_b) {
|
||||
return pe == PredSafeCallCleanup;
|
||||
}
|
||||
|
||||
static Int JumpToEnv() {
|
||||
static Int JumpToEnv(USES_REGS1) {
|
||||
choiceptr handler = B;
|
||||
/* just keep the throwm object away, we don't need to care about it
|
||||
*/
|
||||
@ -2040,15 +2041,11 @@ bool is_cleanup_cp(choiceptr cp_b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Yap_JumpToEnv(Term t) {
|
||||
bool Yap_JumpToEnv(void) {
|
||||
CACHE_REGS
|
||||
if (t)
|
||||
LOCAL_BallTerm = Yap_StoreTermInDB(t, 0);
|
||||
if (!LOCAL_BallTerm)
|
||||
return false;
|
||||
if (LOCAL_PrologMode & TopGoalMode)
|
||||
return true;
|
||||
return JumpToEnv(PASS_REGS);
|
||||
return JumpToEnv(PASS_REGS1);
|
||||
}
|
||||
|
||||
/* This does very nasty stuff!!!!! */
|
||||
@ -2059,8 +2056,7 @@ static Int jump_env(USES_REGS1) {
|
||||
return false;
|
||||
} else if (IsApplTerm(t) && FunctorOfTerm(t) == FunctorError) {
|
||||
Term t2;
|
||||
|
||||
Yap_find_prolog_culprit(PASS_REGS1);
|
||||
Yap_prolog_add_culprit(LOCAL_ActiveError PASS_REGS);
|
||||
// LOCAL_Error_TYPE = ERROR_EVENT;
|
||||
Term t1 = ArgOfTerm(1, t);
|
||||
if (IsApplTerm(t1) && IsAtomTerm((t2 = ArgOfTerm(1, t1)))) {
|
||||
@ -2071,13 +2067,12 @@ static Int jump_env(USES_REGS1) {
|
||||
LOCAL_ActiveError->classAsText = NULL;
|
||||
}
|
||||
} else {
|
||||
Yap_find_prolog_culprit(PASS_REGS1);
|
||||
Yap_prolog_add_culprit(LOCAL_ActiveError PASS_REGS);
|
||||
LOCAL_ActiveError->errorAsText = NULL;
|
||||
LOCAL_ActiveError->classAsText = NULL;
|
||||
//return true;
|
||||
}
|
||||
LOCAL_ActiveError->prologPredName = NULL;
|
||||
Yap_PutException(t);
|
||||
bool out = JumpToEnv(PASS_REGS1);
|
||||
if (B != NULL && P == FAILCODE && B->cp_ap == NOCODE &&
|
||||
LCL0 - (CELL *)B > LOCAL_CBorder) {
|
||||
@ -2183,61 +2178,6 @@ static Int jump_env(USES_REGS1) {
|
||||
#endif
|
||||
}
|
||||
|
||||
Term Yap_GetException(void) {
|
||||
CACHE_REGS
|
||||
Term t = 0;
|
||||
|
||||
if (LOCAL_BallTerm) {
|
||||
t = Yap_PopTermFromDB(LOCAL_BallTerm);
|
||||
}
|
||||
LOCAL_BallTerm = NULL;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
Term Yap_PeekException(void) { return Yap_FetchTermFromDB(LOCAL_BallTerm); }
|
||||
|
||||
bool Yap_RaiseException(void) {
|
||||
if (LOCAL_BallTerm == NULL)
|
||||
return false;
|
||||
return JumpToEnv();
|
||||
}
|
||||
|
||||
bool Yap_PutException(Term t) {
|
||||
CACHE_REGS
|
||||
if ((LOCAL_BallTerm = Yap_StoreTermInDB(t, 0)) != NULL)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Yap_ResetException(int wid) {
|
||||
// reset errir descriptir
|
||||
yap_error_descriptor_t *bf = REMOTE_ActiveError(wid)->top_error;
|
||||
if (REMOTE_ActiveError(wid)->errorTerm) {
|
||||
Yap_PopTermFromDB(REMOTE_ActiveError(wid)->errorTerm);
|
||||
}
|
||||
memset(REMOTE_ActiveError(wid), 0, sizeof(*LOCAL_ActiveError));
|
||||
REMOTE_ActiveError(wid)->top_error = bf;
|
||||
return true;
|
||||
}
|
||||
|
||||
static Int reset_exception(USES_REGS1) { return Yap_ResetException(worker_id); }
|
||||
|
||||
static Int get_exception(USES_REGS1) {
|
||||
fprintf(stderr,"HR befo get_xc=%p\n", HR);
|
||||
Term t = Yap_GetException();
|
||||
fprintf(stderr,"HR befo get_xc=%p\n", HR);
|
||||
if (t == 0)
|
||||
return false;
|
||||
Yap_DebugPlWriteln(t);
|
||||
Yap_ResetException(worker_id);
|
||||
fprintf(stderr,"HR after get_xc=%p\n", HR);
|
||||
Int rc= Yap_unify(t, ARG1);
|
||||
Yap_DebugPlWriteln(t);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int Yap_dogc(int extra_args, Term *tp USES_REGS) {
|
||||
UInt arity;
|
||||
yamop *nextpc;
|
||||
@ -2322,10 +2262,8 @@ return rc;
|
||||
SafePredFlag);
|
||||
Yap_InitCPred("$jump_env_and_store_ball", 1, jump_env, 0);
|
||||
Yap_InitCPred("$generate_pred_info", 4, generate_pred_info, 0);
|
||||
Yap_InitCPred("$reset_exception", 1, reset_exception, 0);
|
||||
Yap_InitCPred("_user_expand_goal", 2, _user_expand_goal, 0);
|
||||
Yap_InitCPred("$do_term_expansion", 2, do_term_expansion, 0);
|
||||
Yap_InitCPred("$get_exception", 1, get_exception, 0);
|
||||
Yap_InitCPred("$setup_call_catcher_cleanup", 1, setup_call_catcher_cleanup,
|
||||
0);
|
||||
Yap_InitCPred("$cleanup_on_exit", 2, cleanup_on_exit, 0);
|
||||
|
@ -1376,7 +1376,7 @@ static bool setInitialValue(bool bootstrap, flag_func f, const char *s,
|
||||
return false;
|
||||
}
|
||||
CACHE_REGS
|
||||
const unsigned char *us = (const unsigned char *)s;
|
||||
const char *us = (const char *)s;
|
||||
t0 = Yap_BufferToTermWithPrioBindings(us, TermNil, 0L, strlen(s) + 1, GLOBAL_MaxPriority);
|
||||
if (!t0)
|
||||
return false;
|
||||
|
254
C/stack.c
254
C/stack.c
@ -537,6 +537,40 @@ static Int find_code_in_clause(PredEntry *pp, yamop *codeptr, void **startp,
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
static bool put_clause_loc(yap_error_descriptor_t *t, void *clcode, PredEntry *pp) {
|
||||
|
||||
CACHE_REGS
|
||||
if (pp->PredFlags & LogUpdatePredFlag) {
|
||||
LogUpdClause *cl = clcode;
|
||||
|
||||
if (cl->ClFlags & FactMask) {
|
||||
t->prologPredLine = cl->lusl.ClLine;
|
||||
} else {
|
||||
t->prologPredLine = cl->lusl.ClSource->ag.line_number;
|
||||
}
|
||||
} else if (pp->PredFlags & DynamicPredFlag) {
|
||||
// DynamicClause *cl;
|
||||
// cl = ClauseCodeToDynamicClause(clcode);
|
||||
|
||||
return false;
|
||||
} else if (pp->PredFlags & MegaClausePredFlag) {
|
||||
MegaClause *mcl = ClauseCodeToMegaClause(pp->cs.p_code.FirstClause);
|
||||
t->prologPredLine = mcl->ClLine;
|
||||
} else {
|
||||
StaticClause *cl;
|
||||
cl = clcode;
|
||||
if (cl->ClFlags & FactMask) {
|
||||
t->prologPredLine = cl->usc.ClLine;
|
||||
} else if (cl->ClFlags & SrcMask) {
|
||||
t->prologPredLine = cl->usc.ClSource->ag.line_number;
|
||||
} else
|
||||
return MkIntTerm(0);
|
||||
}
|
||||
return MkIntTerm(0);
|
||||
}
|
||||
*/
|
||||
|
||||
static Term clause_loc(void *clcode, PredEntry *pp) {
|
||||
|
||||
CACHE_REGS
|
||||
@ -1086,54 +1120,52 @@ static Term clause_info(yamop *codeptr, PredEntry *pp) {
|
||||
return Yap_MkApplTerm(FunctorModule, 2, ts);
|
||||
}
|
||||
|
||||
bool set_clause_info(yamop *codeptr, PredEntry *pp) {
|
||||
yap_error_descriptor_t * set_clause_info(yap_error_descriptor_t *t, yamop *codeptr, PredEntry *pp) {
|
||||
CACHE_REGS
|
||||
Term ts[2];
|
||||
void *begin;
|
||||
if (pp->ArityOfPE == 0) {
|
||||
LOCAL_ActiveError->prologPredName =
|
||||
RepAtom((Atom)pp->FunctorOfPred)->StrOfAE;
|
||||
LOCAL_ActiveError->prologPredArity = 0;
|
||||
t->prologPredName =
|
||||
AtomName((Atom)pp->FunctorOfPred);
|
||||
t->prologPredArity = 0;
|
||||
} else {
|
||||
LOCAL_ActiveError->prologPredName =
|
||||
RepAtom(NameOfFunctor(pp->FunctorOfPred))->StrOfAE;
|
||||
LOCAL_ActiveError->prologPredArity = pp->ArityOfPE;
|
||||
t->prologPredName =
|
||||
AtomName(NameOfFunctor(pp->FunctorOfPred));
|
||||
t->prologPredArity = pp->ArityOfPE;
|
||||
}
|
||||
LOCAL_ActiveError->prologPredModule =
|
||||
t->prologPredModule =
|
||||
(pp->ModuleOfPred ? RepAtom(AtomOfTerm(pp->ModuleOfPred))->StrOfAE
|
||||
: "prolog");
|
||||
LOCAL_ActiveError->prologPredFile = RepAtom(pp->src.OwnerFile)->StrOfAE;
|
||||
t->prologPredFile = RepAtom(pp->src.OwnerFile)->StrOfAE;
|
||||
if (codeptr->opc == UNDEF_OPCODE) {
|
||||
LOCAL_ActiveError->prologPredFirstLine = 0;
|
||||
LOCAL_ActiveError->prologPredLine = 0;
|
||||
LOCAL_ActiveError->prologPredLastLine = 0;
|
||||
return true;
|
||||
t->prologPredFirstLine = 0;
|
||||
t->prologPredLine = 0;
|
||||
t->prologPredLastLine = 0;
|
||||
return t;
|
||||
} else if (pp->cs.p_code.NOfClauses) {
|
||||
if ((LOCAL_ActiveError->prologPredCl =
|
||||
if ((t->prologPredCl =
|
||||
find_code_in_clause(pp, codeptr, &begin, NULL)) <= 0) {
|
||||
LOCAL_ActiveError->prologPredLine = 0;
|
||||
t->prologPredLine = 0;
|
||||
} else {
|
||||
LOCAL_ActiveError->prologPredLine = IntegerOfTerm(clause_loc(begin, pp));
|
||||
t->prologPredLine = IntegerOfTerm(clause_loc(begin, pp));
|
||||
}
|
||||
if (pp->PredFlags & LogUpdatePredFlag) {
|
||||
LOCAL_ActiveError->prologPredFirstLine = IntegerOfTerm(
|
||||
ts[0] = clause_loc(
|
||||
ClauseCodeToLogUpdClause(pp->cs.p_code.FirstClause), pp));
|
||||
LOCAL_ActiveError->prologPredLastLine = IntegerOfTerm(
|
||||
ts[1] = clause_loc(ClauseCodeToLogUpdClause(pp->cs.p_code.LastClause),
|
||||
pp));
|
||||
t->prologPredFirstLine = clause_loc(
|
||||
ClauseCodeToLogUpdClause(pp->cs.p_code.FirstClause), pp);
|
||||
t->prologPredLastLine = clause_loc(ClauseCodeToLogUpdClause(pp->cs.p_code.LastClause),
|
||||
pp);
|
||||
|
||||
} else {
|
||||
LOCAL_ActiveError->prologPredFirstLine = IntegerOfTerm(
|
||||
t->prologPredFirstLine = IntegerOfTerm(
|
||||
ts[0] = clause_loc(
|
||||
ClauseCodeToStaticClause(pp->cs.p_code.FirstClause), pp));
|
||||
LOCAL_ActiveError->prologPredLastLine = IntegerOfTerm(
|
||||
t->prologPredLastLine = IntegerOfTerm(
|
||||
ts[1] = clause_loc(ClauseCodeToStaticClause(pp->cs.p_code.LastClause),
|
||||
pp));
|
||||
}
|
||||
return true;
|
||||
return t;
|
||||
} else {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1161,13 +1193,13 @@ static Term error_culprit(bool internal USES_REGS) {
|
||||
return TermNil;
|
||||
}
|
||||
|
||||
bool Yap_find_prolog_culprit(USES_REGS1) {
|
||||
yap_error_descriptor_t * Yap_prolog_add_culprit(yap_error_descriptor_t *t PASS_REGS) {
|
||||
PredEntry *pe;
|
||||
void *startp, *endp;
|
||||
// case number 1: Yap_Error called from built-in.
|
||||
pe = ClauseInfoForCode(P, &startp, &endp PASS_REGS);
|
||||
if (pe && (CurrentModule == 0 || !(pe->PredFlags & HiddenPredFlag))) {
|
||||
return set_clause_info(P, pe);
|
||||
return set_clause_info(t, P, pe);
|
||||
} else {
|
||||
CELL *curENV = ENV;
|
||||
yamop *curCP = CP;
|
||||
@ -1183,11 +1215,11 @@ bool Yap_find_prolog_culprit(USES_REGS1) {
|
||||
pe = PredMetaCall;
|
||||
}
|
||||
if (pe->ModuleOfPred)
|
||||
return set_clause_info(curCP, pe);
|
||||
return set_clause_info(t, curCP, pe);
|
||||
curCP = (yamop *)(curENV[E_CP]);
|
||||
}
|
||||
}
|
||||
return TermNil;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Term all_calls(bool internal USES_REGS) {
|
||||
@ -1998,26 +2030,24 @@ void Yap_detect_bug_location(yamop *yap_pc, int where_from, int psize) {
|
||||
}
|
||||
}
|
||||
|
||||
static Term build_bug_location(yamop *codeptr, PredEntry *pe) {
|
||||
static yap_error_descriptor_t *add_bug_location(yap_error_descriptor_t *p, yamop *codeptr, PredEntry *pe) {
|
||||
CACHE_REGS
|
||||
Term p[5];
|
||||
if (pe->ModuleOfPred == PROLOG_MODULE)
|
||||
p[0] = TermProlog;
|
||||
p->prologPredModule = AtomName(AtomProlog);
|
||||
else
|
||||
p[0] = pe->ModuleOfPred;
|
||||
p->prologPredModule = AtomName(AtomOfTerm(pe->ModuleOfPred));
|
||||
if (pe->ArityOfPE)
|
||||
p[1] = MkAtomTerm(NameOfFunctor(pe->FunctorOfPred));
|
||||
p->prologPredName = AtomName(NameOfFunctor(pe->FunctorOfPred));
|
||||
else
|
||||
p[1] = MkAtomTerm((Atom)pe->FunctorOfPred);
|
||||
p[2] = MkIntegerTerm(pe->ArityOfPE);
|
||||
p[3] = TermNil;
|
||||
p[4] = MkIntTerm(0);
|
||||
p->prologPredName = AtomName((Atom)(pe->FunctorOfPred));
|
||||
p->prologPredArity = pe->ArityOfPE;
|
||||
p->prologPredFile = AtomName( pe->src.OwnerFile );
|
||||
p->prologPredLine = 0;
|
||||
if (pe->src.OwnerFile) {
|
||||
p[3] = MkAtomTerm(pe->src.OwnerFile);
|
||||
if (pe->PredFlags & MegaClausePredFlag) {
|
||||
MegaClause *mcl;
|
||||
mcl = ClauseCodeToMegaClause(pe->cs.p_code.FirstClause);
|
||||
p[4] = MkIntegerTerm(mcl->ClLine);
|
||||
p->prologPredLine = mcl->ClLine;
|
||||
} else {
|
||||
void *clcode;
|
||||
if (find_code_in_clause(pe, codeptr, &clcode, NULL) > 0) {
|
||||
@ -2025,93 +2055,135 @@ static Term build_bug_location(yamop *codeptr, PredEntry *pe) {
|
||||
LogUpdClause *cl = clcode;
|
||||
|
||||
if (cl->ClFlags & FactMask) {
|
||||
p[4] = MkIntegerTerm(cl->lusl.ClLine);
|
||||
} else {
|
||||
p[4] = MkIntegerTerm(cl->lusl.ClSource->ag.line_number);
|
||||
p->prologPredLine = cl->lusl.ClSource->ag.line_number;
|
||||
}
|
||||
} else if (pe->PredFlags & DynamicPredFlag) {
|
||||
|
||||
p[4] = MkIntTerm(0);
|
||||
p->prologPredLine = 0;
|
||||
} else {
|
||||
StaticClause *cl;
|
||||
cl = clcode;
|
||||
|
||||
if (cl->ClFlags & FactMask) {
|
||||
p[4] = MkIntTerm(cl->usc.ClLine);
|
||||
p->prologPredLine = MkIntTerm(cl->usc.ClLine);
|
||||
} else if (cl->ClFlags & SrcMask) {
|
||||
p[4] = MkIntTerm(cl->usc.ClSource->ag.line_number);
|
||||
p->prologPredLine = cl->usc.ClSource->ag.line_number;
|
||||
} else
|
||||
p[4] = MkIntTerm(0);
|
||||
p->prologPredLine = 0;
|
||||
}
|
||||
} else {
|
||||
p[4] = MkIntTerm(0);
|
||||
p->prologPredLine = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pe->OpcodeOfPred == UNDEF_OPCODE) {
|
||||
RESET_VARIABLE(p + 3);
|
||||
RESET_VARIABLE(p + 4);
|
||||
}
|
||||
p->prologPredFile = "undefined";
|
||||
}
|
||||
else {
|
||||
// by default, user_input
|
||||
p[3] = MkAtomTerm(AtomUserIn);
|
||||
p[4] = MkIntTerm(0);
|
||||
p->prologPredFile = AtomName( AtomUserIn );
|
||||
p->prologPredLine = 0;
|
||||
}
|
||||
return Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("p"), 5), 5, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
Term Yap_pc_location(yamop *pc, choiceptr b_ptr, CELL *env) {
|
||||
yap_error_descriptor_t * Yap_pc_add_location(yap_error_descriptor_t *t, void *pc0, void *b_ptr0, void *env0) {
|
||||
CACHE_REGS
|
||||
yamop *codeptr = pc;
|
||||
PredEntry *pe;
|
||||
yamop *xc = pc0;
|
||||
// choiceptr b_ptr = b_ptr0;
|
||||
//CELL *env = env0;
|
||||
|
||||
PredEntry *pe;
|
||||
if (PP == NULL) {
|
||||
if (PredForCode(pc, NULL, NULL, NULL, &pe) <= 0)
|
||||
return TermNil;
|
||||
if (PredForCode(xc, NULL, NULL, NULL, &pe) <= 0)
|
||||
return NULL;
|
||||
} else
|
||||
pe = PP;
|
||||
if (pe != NULL
|
||||
// pe->ModuleOfPred != PROLOG_MODULE &&
|
||||
// &&!(pe->PredFlags & HiddenPredFlag)
|
||||
) {
|
||||
return build_bug_location(codeptr, pe);
|
||||
return add_bug_location(t, xc, pe);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
yap_error_descriptor_t *Yap_env_add_location(yap_error_descriptor_t *t,void *cp0, void *b_ptr0, void *env0, YAP_Int ignore_first) {
|
||||
yamop *cp = cp0;
|
||||
choiceptr b_ptr = b_ptr0;
|
||||
CELL *env = env0;
|
||||
while (true) {
|
||||
if (b_ptr == NULL || env == NULL)
|
||||
return NULL;
|
||||
PredEntry *pe = EnvPreg(cp);
|
||||
if (pe == PredTrue)
|
||||
return NULL;
|
||||
if (ignore_first <= 0 &&
|
||||
pe
|
||||
// pe->ModuleOfPred != PROLOG_MODULE &&s
|
||||
&& !(pe->PredFlags & HiddenPredFlag)) {
|
||||
return add_bug_location(t, cp, pe);
|
||||
} else {
|
||||
if (NULL && b_ptr && b_ptr->cp_env < env) {
|
||||
cp = b_ptr->cp_cp;
|
||||
env = b_ptr->cp_env;
|
||||
b_ptr = b_ptr->cp_b;
|
||||
} else {
|
||||
cp = (yamop *)env[E_CP];
|
||||
env = ENV_Parent(env);
|
||||
}
|
||||
ignore_first--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Term Yap_env_location(yamop *cp, choiceptr b_ptr, CELL *env, Int ignore_first) {
|
||||
while (true) {
|
||||
if (b_ptr == NULL || env == NULL)
|
||||
return TermNil;
|
||||
PredEntry *pe = EnvPreg(cp);
|
||||
if (pe == PredTrue)
|
||||
return TermNil;
|
||||
if (ignore_first <= 0 &&
|
||||
pe
|
||||
// pe->ModuleOfPred != PROLOG_MODULE &&s
|
||||
&& !(pe->PredFlags & HiddenPredFlag)) {
|
||||
return add_bug_location(cp, pe);
|
||||
} else {
|
||||
if (NULL && b_ptr && b_ptr->cp_env < env) {
|
||||
cp = b_ptr->cp_cp;
|
||||
env = b_ptr->cp_env;
|
||||
b_ptr = b_ptr->cp_b;
|
||||
} else {
|
||||
cp = (yamop *)env[E_CP];
|
||||
env = ENV_Parent(env);
|
||||
}
|
||||
ignore_first--;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
static Term mkloc(yap_error_descriptor_t *t)
|
||||
{
|
||||
return TermNil;
|
||||
}
|
||||
|
||||
Term Yap_env_location(yamop *cp, choiceptr b_ptr, CELL *env, Int ignore_first) {
|
||||
while (true) {
|
||||
if (b_ptr == NULL || env == NULL)
|
||||
return TermNil;
|
||||
PredEntry *pe = EnvPreg(cp);
|
||||
if (pe == PredTrue)
|
||||
return TermNil;
|
||||
if (ignore_first <= 0 &&
|
||||
pe
|
||||
// pe->ModuleOfPred != PROLOG_MODULE &&s
|
||||
&& !(pe->PredFlags & HiddenPredFlag)) {
|
||||
return build_bug_location(cp, pe);
|
||||
} else {
|
||||
if (NULL && b_ptr && b_ptr->cp_env < env) {
|
||||
cp = b_ptr->cp_cp;
|
||||
env = b_ptr->cp_env;
|
||||
b_ptr = b_ptr->cp_b;
|
||||
} else {
|
||||
cp = (yamop *)env[E_CP];
|
||||
env = ENV_Parent(env);
|
||||
}
|
||||
ignore_first--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Int clause_location(USES_REGS1) {
|
||||
return Yap_unify(Yap_pc_location(P, B, ENV), ARG1) &&
|
||||
Yap_unify(Yap_env_location(CP, B, ENV, 1), ARG2);
|
||||
yap_error_descriptor_t t;
|
||||
memset( &t, 0, sizeof(yap_error_descriptor_t));
|
||||
return Yap_unify(mkloc(Yap_pc_add_location(&t,P, B, ENV)), ARG1) &&
|
||||
Yap_unify(mkloc(Yap_env_add_location(&t,CP, B, ENV, 1)), ARG2);
|
||||
}
|
||||
|
||||
static Int ancestor_location(USES_REGS1) {
|
||||
return Yap_unify(Yap_env_location(CP, B, ENV, 2), ARG1) &&
|
||||
Yap_unify(Yap_env_location(CP, B, ENV, 3), ARG2);
|
||||
yap_error_descriptor_t t;
|
||||
memset( &t, 0, sizeof(yap_error_descriptor_t));
|
||||
return
|
||||
Yap_unify(mkloc(Yap_env_add_location(&t,CP, B, ENV, 2)), ARG2) &&
|
||||
Yap_unify(mkloc(Yap_env_add_location(&t,CP, B, ENV, 3)), ARG2);
|
||||
|
||||
}
|
||||
|
||||
void Yap_InitStInfo(void) {
|
||||
|
@ -1817,7 +1817,8 @@ p_new_mutex(void)
|
||||
if (creeping) {
|
||||
Yap_signal( YAP_CREEP_SIGNAL );
|
||||
} else if ( excep != 0) {
|
||||
return Yap_JumpToEnv(excep);
|
||||
LOCAL_ActiveError->errorNo = IntegerOfTerm(excep);
|
||||
return Yap_JumpToEnv();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
@ -1255,11 +1255,11 @@ char *Yap_TermToBuffer(Term t, encoding_t enc, int flags) {
|
||||
CACHE_REGS
|
||||
int sno = Yap_open_buf_write_stream(enc, flags);
|
||||
const char *sf;
|
||||
DBTerm *e = LOCAL_BallTerm;
|
||||
yap_error_descriptor_t ne;
|
||||
|
||||
if (sno < 0)
|
||||
return NULL;
|
||||
LOCAL_c_output_stream = sno;
|
||||
Yap_pushErrorContext(&ne);
|
||||
if (enc)
|
||||
GLOBAL_Stream[sno].encoding = enc;
|
||||
else
|
||||
@ -1271,7 +1271,6 @@ char *Yap_TermToBuffer(Term t, encoding_t enc, int flags) {
|
||||
char *new = malloc(len + 1);
|
||||
strcpy(new, sf);
|
||||
Yap_CloseStream(sno);
|
||||
if (e)
|
||||
LOCAL_BallTerm = e;
|
||||
Yap_popErrorContext (true);
|
||||
return new;
|
||||
}
|
||||
|
10
C/yap-args.c
10
C/yap-args.c
@ -202,12 +202,12 @@ static void consult(const char *b_file USES_REGS) {
|
||||
YAP_RunGoalOnce(t);
|
||||
}
|
||||
} else {
|
||||
char *ErrorMessage;
|
||||
ErrorMessage = YAP_CompileClause(t);
|
||||
if (ErrorMessage) {
|
||||
fprintf(stderr, "%s", ErrorMessage);
|
||||
}
|
||||
YAP_CompileClause(t);
|
||||
}
|
||||
Term terr;
|
||||
Yap_PrintException();
|
||||
if ((terr = Yap_GetException()))
|
||||
fprintf(stderr,"Exception Found\n");
|
||||
} while (t != TermEof);
|
||||
BACKUP_MACHINE_REGS();
|
||||
YAP_EndConsult(c_stream, &osno, full);
|
||||
|
@ -1,6 +1,6 @@
|
||||
# This is the CMakeCache file.
|
||||
# For build in directory: /home/vsc/github/yap-6.3
|
||||
# It was generated by CMake: /usr/bin/cmake
|
||||
# It was generated by CMake: /home/vsc/clion-2018.1/bin/cmake/bin/cmake
|
||||
# You can edit this file to change values found and used by cmake.
|
||||
# If you do not want to change any of the values, simply exit the editor.
|
||||
# If you do want to change a value, simply edit, save, and exit the editor.
|
||||
@ -345,7 +345,7 @@ LIBXML2_INCLUDE_DIR:PATH=/home/vsc/anaconda3/conda-bld/yap4py_1522051601517/_h_e
|
||||
LIBXML2_LIBRARIES:FILEPATH=/home/vsc/anaconda3/conda-bld/yap4py_1522051601517/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/libxml2.so
|
||||
|
||||
//Path to a library.
|
||||
LIBXML2_LIBRARY:FILEPATH=LIBXML2_LIBRARY-NOTFOUND
|
||||
LIBXML2_LIBRARY:FILEPATH=/home/vsc/anaconda3/conda-bld/yap4py_1522051601517/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/libxml2.so
|
||||
|
||||
//Path to a program.
|
||||
LIBXML2_XMLLINT_EXECUTABLE:FILEPATH=/usr/bin/xmllint
|
||||
@ -792,17 +792,17 @@ CMAKE_CACHEFILE_DIR:INTERNAL=/home/vsc/github/yap-6.3
|
||||
//Major version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
|
||||
//Minor version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_MINOR_VERSION:INTERNAL=9
|
||||
CMAKE_CACHE_MINOR_VERSION:INTERNAL=10
|
||||
//Patch version of cmake used to create the current loaded cache
|
||||
CMAKE_CACHE_PATCH_VERSION:INTERNAL=1
|
||||
CMAKE_CACHE_PATCH_VERSION:INTERNAL=2
|
||||
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
|
||||
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
|
||||
//Path to CMake executable.
|
||||
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
|
||||
CMAKE_COMMAND:INTERNAL=/home/vsc/clion-2018.1/bin/cmake/bin/cmake
|
||||
//Path to cpack program executable.
|
||||
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
|
||||
CMAKE_CPACK_COMMAND:INTERNAL=/home/vsc/clion-2018.1/bin/cmake/bin/cpack
|
||||
//Path to ctest program executable.
|
||||
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
|
||||
CMAKE_CTEST_COMMAND:INTERNAL=/home/vsc/clion-2018.1/bin/cmake/bin/ctest
|
||||
//ADVANCED property for variable: CMAKE_CXX_COMPILER
|
||||
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
|
||||
@ -925,7 +925,7 @@ CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_RANLIB
|
||||
CMAKE_RANLIB-ADVANCED:INTERNAL=1
|
||||
//Path to CMake installation.
|
||||
CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.9
|
||||
CMAKE_ROOT:INTERNAL=/home/vsc/clion-2018.1/bin/cmake/share/cmake-3.10
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
|
||||
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
||||
|
@ -107,10 +107,10 @@ protected:
|
||||
YAPPredicate(const char *s0, Term &tout, Term &tnames) {
|
||||
CACHE_REGS
|
||||
Term *modp = NULL;
|
||||
const unsigned char *us = (const unsigned char *)s0;
|
||||
const char *s = (const char *)s0;
|
||||
tnames = MkVarTerm();
|
||||
tout =
|
||||
Yap_BufferToTermWithPrioBindings(us, TermNil, tnames, strlen(s0), 1200);
|
||||
Yap_BufferToTermWithPrioBindings(s, TermNil, tnames, strlen(s0), 1200);
|
||||
// fprintf(stderr,"ap=%p arity=%d text=%s", ap, ap->ArityOfPE, s);
|
||||
// Yap_DebugPlWrite(out);
|
||||
if (tout == 0L) {
|
||||
|
14
CXX/yapi.cpp
14
CXX/yapi.cpp
@ -435,7 +435,7 @@ bool YAPEngine::call(YAPPredicate ap, YAPTerm ts[]) {
|
||||
result = YAP_LeaveGoal(false, &q);
|
||||
Term terr;
|
||||
|
||||
if ((terr = Yap_PeekException()) != 0) {
|
||||
if ((terr = Yap_GetException()) != 0) {
|
||||
std::cerr << "Exception received by " << __func__ << "( "
|
||||
<< YAPTerm(terr).text() << ").\n Forwarded...\n\n";
|
||||
// Yap_PopTermFromDB(LOCAL_ActiveError->errorTerm);
|
||||
@ -482,7 +482,7 @@ bool YAPEngine::mgoal(Term t, Term tmod) {
|
||||
|
||||
result = (bool)YAP_EnterGoal(ap, nullptr, &q);
|
||||
Term terr;
|
||||
if ((terr = Yap_PeekException()) != 0) {
|
||||
if ((terr = Yap_GetException()) != 0) {
|
||||
std::cerr << "Exception received by " << __func__ << "( "
|
||||
<< YAPTerm(terr).text() << ").\n Forwarded...\n\n";
|
||||
// Yap_PopTermFromDB(LOCAL_ActiveError->errorTerm);
|
||||
@ -551,7 +551,7 @@ Term YAPEngine::fun(Term t) {
|
||||
__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec ");
|
||||
|
||||
bool result = (bool)YAP_EnterGoal(ap, nullptr, &q);
|
||||
if ((terr = Yap_PeekException()) != 0) {
|
||||
if ((terr = Yap_GetException()) != 0) {
|
||||
std::cerr << "Exception received by " << __func__ << "( "
|
||||
<< YAPTerm(terr).text() << ").\n Forwarded...\n\n";
|
||||
// Yap_PopTermFromDB(LOCAL_ActiveError->errorTerm);
|
||||
@ -982,14 +982,6 @@ std::string YAPError::text() {
|
||||
s += ".";
|
||||
s += LOCAL_ActiveError->errorAsText;
|
||||
s += ".\n";
|
||||
if (LOCAL_ActiveError->errorTerm) {
|
||||
Term t = Yap_PopTermFromDB(LOCAL_ActiveError->errorTerm);
|
||||
if (t) {
|
||||
s += "error term is: ";
|
||||
s += YAPTerm(t).text();
|
||||
s += "\n";
|
||||
}
|
||||
}
|
||||
// printf("%s\n", s.c_str());
|
||||
return s.c_str();
|
||||
}
|
||||
|
@ -177,7 +177,11 @@ extern void Yap_InitDBPreds(void);
|
||||
extern const char *Yap_PrintPredName(struct pred_entry *ap);
|
||||
#endif
|
||||
extern void Yap_RestartYap(int);
|
||||
extern void Yap_exit(int);
|
||||
extern void Yap_exit(int)
|
||||
#ifndef MSC_VER
|
||||
__attribute__((noreturn))
|
||||
#endif
|
||||
;
|
||||
extern bool Yap_Warning(const char *s, ...);
|
||||
extern bool Yap_PrintWarning(Term t);
|
||||
extern bool Yap_HandleError__(const char *file, const char *function, int lineno,
|
||||
@ -194,7 +198,7 @@ extern void Yap_InitEval(void);
|
||||
extern void Yap_fail_all(choiceptr bb USES_REGS);
|
||||
extern Term Yap_ExecuteCallMetaCall(Term,Term);
|
||||
extern void Yap_InitExecFs(void);
|
||||
extern bool Yap_JumpToEnv(Term);
|
||||
extern bool Yap_JumpToEnv(void);
|
||||
extern Term Yap_RunTopGoal(Term, bool);
|
||||
extern bool Yap_execute_goal(Term, int, Term, bool);
|
||||
extern bool Yap_exec_absmi(bool, yap_reset_t);
|
||||
|
44
H/Yatom.h
44
H/Yatom.h
@ -1303,18 +1303,23 @@ INLINE_ONLY inline EXTERN bool IsFlagProperty(PropFlags flags) {
|
||||
|
||||
/* Proto types */
|
||||
|
||||
|
||||
extern char *Yap_TermToBuffer(Term t, encoding_t encoding, int flags);
|
||||
|
||||
extern Term Yap_BufferToTerm(const char *s, Term opts);
|
||||
|
||||
/* cdmgr.c */
|
||||
int Yap_RemoveIndexation(PredEntry *);
|
||||
void Yap_UpdateTimestamps(PredEntry *);
|
||||
extern int Yap_RemoveIndexation(PredEntry *);
|
||||
extern void Yap_UpdateTimestamps(PredEntry *);
|
||||
|
||||
/* dbase.c */
|
||||
void Yap_ErDBE(DBRef);
|
||||
DBTerm *Yap_StoreTermInDB(Term, int);
|
||||
extern void Yap_ErDBE(DBRef);
|
||||
extern DBTerm *Yap_StoreTermInDB(Term, int);
|
||||
DBTerm *Yap_StoreTermInDBPlusExtraSpace(Term, UInt, UInt *);
|
||||
Term Yap_FetchTermFromDB(void *);
|
||||
Term Yap_FetchClauseTermFromDB(void *);
|
||||
Term Yap_PopTermFromDB(void *);
|
||||
void Yap_ReleaseTermFromDB(void *);
|
||||
Term Yap_FetchTermFromDB(const void *);
|
||||
Term Yap_FetchClauseTermFromDB(const void *);
|
||||
Term Yap_PopTermFromDB(const void *);
|
||||
void Yap_ReleaseTermFromDB(const void *);
|
||||
|
||||
/* init.c */
|
||||
Atom Yap_GetOp(OpEntry *, int *, int);
|
||||
@ -1335,6 +1340,7 @@ Prop Yap_GetAPropHavingLock(AtomEntry *, PropFlags);
|
||||
*************************************************************************************************/
|
||||
|
||||
#include "YapFlags.h"
|
||||
|
||||
INLINE_ONLY EXTERN inline UInt PRED_HASH(FunctorEntry *, Term, UInt);
|
||||
|
||||
INLINE_ONLY EXTERN inline UInt PRED_HASH(FunctorEntry *fe, Term cur_mod,
|
||||
@ -1595,22 +1601,14 @@ INLINE_ONLY inline EXTERN const char *AtomTermName(Term t) {
|
||||
return RepAtom(AtomOfTerm(t))->rep.uStrOfAE;
|
||||
}
|
||||
|
||||
bool Yap_ResetException(int wid);
|
||||
bool Yap_HasException(void);
|
||||
Term Yap_GetException(void);
|
||||
Term Yap_PeekException(void);
|
||||
bool Yap_PutException(Term t);
|
||||
extern bool Yap_ResetException(int wid);
|
||||
extern bool Yap_HasException(void);
|
||||
extern Term Yap_GetException(void);
|
||||
extern void Yap_PrintException(void);
|
||||
INLINE_ONLY inline EXTERN bool Yap_HasException(void) {
|
||||
return LOCAL_BallTerm != NULL;
|
||||
return LOCAL_ActiveError->errorNo != YAP_NO_ERROR;
|
||||
}
|
||||
INLINE_ONLY inline EXTERN void *Yap_RefToException(void) {
|
||||
void *dbt = LOCAL_BallTerm;
|
||||
LOCAL_BallTerm = NULL;
|
||||
return dbt;
|
||||
}
|
||||
INLINE_ONLY inline EXTERN void Yap_CopyException(DBTerm *dbt) {
|
||||
LOCAL_BallTerm = dbt;
|
||||
}
|
||||
bool Yap_RaiseException(void);
|
||||
|
||||
extern bool Yap_RaiseException(void);
|
||||
|
||||
#endif
|
||||
|
10
H/clause.h
10
H/clause.h
@ -457,12 +457,12 @@ LogUpdClause *Yap_new_ludbe(Term, PredEntry *, UInt);
|
||||
Term Yap_LUInstance(LogUpdClause *, UInt);
|
||||
|
||||
/* udi.c */
|
||||
int Yap_new_udi_clause(PredEntry *, yamop *, Term);
|
||||
yamop *Yap_udi_search(PredEntry *);
|
||||
extern int Yap_new_udi_clause(PredEntry *, yamop *, Term);
|
||||
extern yamop *Yap_udi_search(PredEntry *);
|
||||
|
||||
Term Yap_bug_location(yamop *p, yamop *cp, choiceptr b_ptr, CELL *env);
|
||||
Term Yap_pc_location(yamop *p, choiceptr b_ptr, CELL *env);
|
||||
Term Yap_env_location(yamop *p, choiceptr b_ptr, CELL *env, Int ignore_first);
|
||||
extern yap_error_descriptor_t *Yap_bug_location(yap_error_descriptor_t *t, yamop *p, yamop *cp, choiceptr b_ptr, void *env);
|
||||
extern yap_error_descriptor_t *Yap_pc_add_location(yap_error_descriptor_t *t, void *p, void *b_ptr, void *env);
|
||||
extern yap_error_descriptor_t * Yap_env_add_location(yap_error_descriptor_t *t, void *p, void *b_ptr, void *env, YAP_Int ignore_first);
|
||||
|
||||
#if LOW_PROF
|
||||
void Yap_InformOfRemoval(void *);
|
||||
|
@ -943,18 +943,10 @@ static void RestoreForeignCode__(USES_REGS1) {
|
||||
}
|
||||
}
|
||||
|
||||
static void RestoreBallTerm(int wid) {
|
||||
CACHE_REGS
|
||||
if (LOCAL_BallTerm) {
|
||||
LOCAL_BallTerm = DBTermAdjust(LOCAL_BallTerm);
|
||||
RestoreDBTerm(LOCAL_BallTerm, false, 1 PASS_REGS);
|
||||
}
|
||||
}
|
||||
|
||||
static void RestoreYapRecords__(USES_REGS1) {
|
||||
struct record_list *ptr;
|
||||
|
||||
RestoreBallTerm(worker_id);
|
||||
Yap_Records = DBRecordAdjust(Yap_Records);
|
||||
ptr = Yap_Records;
|
||||
while (ptr) {
|
||||
|
87
YAP.cbp
87
YAP.cbp
@ -1553,6 +1553,90 @@
|
||||
<DistClean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/python/yap_kernel/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="libxml2">
|
||||
<Option output="/home/vsc/github/yap-6.3/packages/raptor/libxml2.so" prefix_auto="0" extension_auto="0"/>
|
||||
<Option working_dir="/home/vsc/github/yap-6.3/packages/raptor"/>
|
||||
<Option object_output="./"/>
|
||||
<Option type="3"/>
|
||||
<Option compiler="clang"/>
|
||||
<Compiler>
|
||||
<Add option="-DDEPTH_LIMIT=1"/>
|
||||
<Add option="-DCOROUTINING=1"/>
|
||||
<Add option="-DRATIONAL_TREES=1"/>
|
||||
<Add option="-D_YAP_NOT_INSTALLED_=1"/>
|
||||
<Add option="-DHAVE_CONFIG_H=1"/>
|
||||
<Add option="-D_GNU_SOURCE"/>
|
||||
<Add option="-DDEBUG=1"/>
|
||||
<Add option="-DTHREADED_CODE=1"/>
|
||||
<Add option="-DLOW_LEVEL_TRACER=1"/>
|
||||
<Add option="-DUTF8PROC=1"/>
|
||||
<Add option="-DUSE_MYDDAS=1"/>
|
||||
<Add option="-DMYDDAS_SQLITE3=1"/>
|
||||
<Add option="-DTABLING=1"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3"/>
|
||||
<Add directory="/usr/include/x86_64-linux-gnu"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/utf8proc"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/myddas"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/H"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/H/generated"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/include"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/os"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/OPTYap"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/JIT/HPP"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/raptor/../../H"/>
|
||||
<Add directory="/home/vsc/anaconda3/conda-bld/yap4py_1522051601517/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/libxml2"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/raptor"/>
|
||||
</Compiler>
|
||||
<MakeCommands>
|
||||
<Build command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 libxml2"/>
|
||||
<CompileFile command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="libxml2/fast">
|
||||
<Option output="/home/vsc/github/yap-6.3/packages/raptor/libxml2.so" prefix_auto="0" extension_auto="0"/>
|
||||
<Option working_dir="/home/vsc/github/yap-6.3/packages/raptor"/>
|
||||
<Option object_output="./"/>
|
||||
<Option type="3"/>
|
||||
<Option compiler="clang"/>
|
||||
<Compiler>
|
||||
<Add option="-DDEPTH_LIMIT=1"/>
|
||||
<Add option="-DCOROUTINING=1"/>
|
||||
<Add option="-DRATIONAL_TREES=1"/>
|
||||
<Add option="-D_YAP_NOT_INSTALLED_=1"/>
|
||||
<Add option="-DHAVE_CONFIG_H=1"/>
|
||||
<Add option="-D_GNU_SOURCE"/>
|
||||
<Add option="-DDEBUG=1"/>
|
||||
<Add option="-DTHREADED_CODE=1"/>
|
||||
<Add option="-DLOW_LEVEL_TRACER=1"/>
|
||||
<Add option="-DUTF8PROC=1"/>
|
||||
<Add option="-DUSE_MYDDAS=1"/>
|
||||
<Add option="-DMYDDAS_SQLITE3=1"/>
|
||||
<Add option="-DTABLING=1"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3"/>
|
||||
<Add directory="/usr/include/x86_64-linux-gnu"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/utf8proc"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/myddas"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/H"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/H/generated"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/include"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/os"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/OPTYap"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/JIT/HPP"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/raptor/../../H"/>
|
||||
<Add directory="/home/vsc/anaconda3/conda-bld/yap4py_1522051601517/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/libxml2"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/raptor"/>
|
||||
</Compiler>
|
||||
<MakeCommands>
|
||||
<Build command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 libxml2/fast"/>
|
||||
<CompileFile command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="xmlpl">
|
||||
<Option working_dir="/home/vsc/github/yap-6.3/packages/xml"/>
|
||||
<Option type="4"/>
|
||||
@ -3538,6 +3622,9 @@
|
||||
<Unit filename="/home/vsc/github/yap-6.3/packages/python/python.h">
|
||||
<Option target="Py4YAP"/>
|
||||
</Unit>
|
||||
<Unit filename="/home/vsc/github/yap-6.3/packages/raptor/xml2_yap.c">
|
||||
<Option target="libxml2"/>
|
||||
</Unit>
|
||||
<Unit filename="/home/vsc/github/yap-6.3/packages/real/real.c">
|
||||
<Option target="real"/>
|
||||
</Unit>
|
||||
|
@ -1,4 +1,9 @@
|
||||
[
|
||||
{
|
||||
"directory": "/home/vsc/github/yap-6.3",
|
||||
"command": "/usr/bin/clang -DCOROUTINING=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DHAVE_CONFIG_H=1 -DLOW_LEVEL_TRACER=1 -DMYDDAS_SQLITE3=1 -DRATIONAL_TREES=1 -DTABLING=1 -DTHREADED_CODE=1 -DUSE_MYDDAS=1 -DUSE_SYSTEM_MALLOC=1 -DUTF8PROC=1 -D_GNU_SOURCE -D_YAP_NOT_INSTALLED_=1 -I/home/vsc/github/yap-6.3 -I/usr/include/x86_64-linux-gnu -I/home/vsc/github/yap-6.3/utf8proc -I/home/vsc/github/yap-6.3/packages/myddas -I/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src -I/home/vsc/github/yap-6.3/H -I/home/vsc/github/yap-6.3/H/generated -I/home/vsc/github/yap-6.3/include -I/home/vsc/github/yap-6.3/os -I/home/vsc/github/yap-6.3/OPTYap -I/home/vsc/github/yap-6.3/JIT/HPP -g3 -gdwarf-2 -fPIE -Wall -fexceptions -o CMakeFiles/yap-bin.dir/console/yap.c.o -c /home/vsc/github/yap-6.3/console/yap.c",
|
||||
"file": "/home/vsc/github/yap-6.3/console/yap.c"
|
||||
},
|
||||
{
|
||||
"directory": "/home/vsc/github/yap-6.3",
|
||||
"command": "/usr/bin/clang -DCOROUTINING=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DHAVE_CONFIG_H=1 -DLOW_LEVEL_TRACER=1 -DMYDDAS_SQLITE3=1 -DRATIONAL_TREES=1 -DTABLING=1 -DTHREADED_CODE=1 -DUSE_MYDDAS=1 -DUSE_SYSTEM_MALLOC=1 -DUTF8PROC=1 -D_GNU_SOURCE -D_YAP_NOT_INSTALLED_=1 -DlibYap_EXPORTS -I/home/vsc/github/yap-6.3 -I/usr/include/x86_64-linux-gnu -I/home/vsc/github/yap-6.3/utf8proc -I/home/vsc/github/yap-6.3/packages/myddas -I/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src -I/home/vsc/github/yap-6.3/H -I/home/vsc/github/yap-6.3/H/generated -I/home/vsc/github/yap-6.3/include -I/home/vsc/github/yap-6.3/os -I/home/vsc/github/yap-6.3/OPTYap -I/home/vsc/github/yap-6.3/JIT/HPP -g3 -gdwarf-2 -fPIC -Wall -fexceptions -o CMakeFiles/libYap.dir/C/absmi.c.o -c /home/vsc/github/yap-6.3/C/absmi.c",
|
||||
@ -364,11 +369,6 @@
|
||||
"command": "/usr/bin/clang -DCOROUTINING=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DHAVE_CONFIG_H=1 -DLOW_LEVEL_TRACER=1 -DMYDDAS_SQLITE3=1 -DRATIONAL_TREES=1 -DTABLING=1 -DTHREADED_CODE=1 -DUSE_MYDDAS=1 -DUSE_SYSTEM_MALLOC=1 -DUTF8PROC=1 -D_GNU_SOURCE -D_YAP_NOT_INSTALLED_=1 -DlibYap_EXPORTS -I/home/vsc/github/yap-6.3 -I/usr/include/x86_64-linux-gnu -I/home/vsc/github/yap-6.3/utf8proc -I/home/vsc/github/yap-6.3/packages/myddas -I/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src -I/home/vsc/github/yap-6.3/H -I/home/vsc/github/yap-6.3/H/generated -I/home/vsc/github/yap-6.3/include -I/home/vsc/github/yap-6.3/os -I/home/vsc/github/yap-6.3/OPTYap -I/home/vsc/github/yap-6.3/JIT/HPP -g3 -gdwarf-2 -fPIC -Wall -fexceptions -o CMakeFiles/libYap.dir/C/clause_list.c.o -c /home/vsc/github/yap-6.3/C/clause_list.c",
|
||||
"file": "/home/vsc/github/yap-6.3/C/clause_list.c"
|
||||
},
|
||||
{
|
||||
"directory": "/home/vsc/github/yap-6.3",
|
||||
"command": "/usr/bin/clang -DCOROUTINING=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DHAVE_CONFIG_H=1 -DLOW_LEVEL_TRACER=1 -DMYDDAS_SQLITE3=1 -DRATIONAL_TREES=1 -DTABLING=1 -DTHREADED_CODE=1 -DUSE_MYDDAS=1 -DUSE_SYSTEM_MALLOC=1 -DUTF8PROC=1 -D_GNU_SOURCE -D_YAP_NOT_INSTALLED_=1 -I/home/vsc/github/yap-6.3 -I/usr/include/x86_64-linux-gnu -I/home/vsc/github/yap-6.3/utf8proc -I/home/vsc/github/yap-6.3/packages/myddas -I/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src -I/home/vsc/github/yap-6.3/H -I/home/vsc/github/yap-6.3/H/generated -I/home/vsc/github/yap-6.3/include -I/home/vsc/github/yap-6.3/os -I/home/vsc/github/yap-6.3/OPTYap -I/home/vsc/github/yap-6.3/JIT/HPP -g3 -gdwarf-2 -fPIE -Wall -fexceptions -o CMakeFiles/yap-bin.dir/console/yap.c.o -c /home/vsc/github/yap-6.3/console/yap.c",
|
||||
"file": "/home/vsc/github/yap-6.3/console/yap.c"
|
||||
},
|
||||
{
|
||||
"directory": "/home/vsc/github/yap-6.3/packages/python",
|
||||
"command": "/usr/bin/clang -DCOROUTINING=1 -DDEBUG=1 -DDEPTH_LIMIT=1 -DHAVE_CONFIG_H=1 -DLOW_LEVEL_TRACER=1 -DMYDDAS_SQLITE3=1 -DPy4YAP_EXPORTS -DRATIONAL_TREES=1 -DTHREADED_CODE=1 -DUSE_MYDDAS=1 -DUTF8PROC=1 -D_GNU_SOURCE -D_YAP_NOT_INSTALLED_=1 -DYAP_KERNEL=1 -D_GNU_SOURCE=1 -I/usr/include/x86_64-linux-gnu -I/home/vsc/github/yap-6.3/utf8proc -I/home/vsc/github/yap-6.3/packages/myddas -I/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src -I/home/vsc/github/yap-6.3 -I/usr/include/python3.6m -I/home/vsc/github/yap-6.3/include -I/home/vsc/github/yap-6.3/os -g3 -gdwarf-2 -fPIC -Wall -fexceptions -o CMakeFiles/Py4YAP.dir/python.c.o -c /home/vsc/github/yap-6.3/packages/python/python.c",
|
||||
|
@ -199,11 +199,11 @@ INLINE_ONLY extern inline Term Yap_ensure_atom__(const char *fu, const char *fi,
|
||||
|
||||
/// all we need to know about an error/throw
|
||||
typedef struct s_yap_error_descriptor {
|
||||
enum yap_error_status status;
|
||||
yap_error_number errorNo;
|
||||
yap_error_class_number errorClass;
|
||||
const char *errorGoal;
|
||||
const char *errorAsText;
|
||||
const char *classAsText;
|
||||
yap_error_number errorNo;
|
||||
intptr_t errorLine;
|
||||
const char *errorFunction;
|
||||
const char *errorFile;
|
||||
@ -223,8 +223,8 @@ INLINE_ONLY extern inline Term Yap_ensure_atom__(const char *fu, const char *fi,
|
||||
const char *prologParserText;
|
||||
const char *prologParserFile;
|
||||
bool prologConsulting;
|
||||
void *errorTerm;
|
||||
uintptr_t rawErrorTerm, rawExtraErrorTerm;
|
||||
const char *culprit;
|
||||
YAP_Term errorRawTerm, rawExtraErrorTerm;
|
||||
char *errorMsg;
|
||||
size_t errorMsgLen;
|
||||
struct s_yap_error_descriptor *top_error;
|
||||
@ -236,11 +236,13 @@ INLINE_ONLY extern inline Term Yap_ensure_atom__(const char *fu, const char *fi,
|
||||
#define LOCAL_Error_Function LOCAL_ActiveError->errorFunction
|
||||
#define LOCAL_Error_Lineno LOCAL_ActiveError->errorLine
|
||||
#define LOCAL_Error_Size LOCAL_ActiveError->errorMsgLen
|
||||
#define LOCAL_BallTerm LOCAL_ActiveError->errorTerm
|
||||
#define LOCAL_RawTerm LOCAL_ActiveError->errorRawTerm
|
||||
#define LOCAL_ErrorMessage LOCAL_ActiveError->errorMsg
|
||||
|
||||
extern bool Yap_find_prolog_culprit(void);
|
||||
extern yap_error_descriptor_t * Yap_pc_add_location(yap_error_descriptor_t *t, void *pc0, void *b_ptr0, void *env0);
|
||||
extern yap_error_descriptor_t *Yap_env_add_location(yap_error_descriptor_t *t,void *cp0, void * b_ptr0, void *env0, YAP_Int ignore_first);
|
||||
|
||||
extern yap_error_descriptor_t *Yap_prolog_add_culprit(yap_error_descriptor_t *t);
|
||||
extern yap_error_class_number Yap_errorClass(yap_error_number e);
|
||||
extern const char *Yap_errorName(yap_error_number e);
|
||||
extern const char *Yap_errorClassName(yap_error_class_number e);
|
||||
|
@ -367,10 +367,12 @@ extern X_API int YAP_WriteDynamicBuffer(YAP_Term t, char *buf, size_t sze,
|
||||
int flags);
|
||||
|
||||
/* void YAP_Term(YAP_Term) */
|
||||
extern X_API YAP_Term YAP_CopyTerm(YAP_Term);
|
||||
extern X_API YAP_Term YAP_CopyTerm(YAP_Term t);
|
||||
|
||||
/* char *YAP_CompileClause(YAP_Term) */
|
||||
extern X_API char *YAP_CompileClause(YAP_Term);
|
||||
/* bool YAP_CompileClause(YAP_Term)
|
||||
|
||||
@short compile the clause _Cl_; on failure it may call the exception handler. */
|
||||
extern X_API bool YAP_CompileClause(YAP_Term Cl);
|
||||
|
||||
extern X_API int YAP_NewExo(YAP_PredEntryPtr ap, size_t data, void *user_di);
|
||||
|
||||
|
@ -1272,18 +1272,15 @@ YAP: NO EQUIVALENT */
|
||||
|
||||
X_API int PL_raise_exception(term_t exception) {
|
||||
CACHE_REGS
|
||||
LOCAL_Error_TYPE = YAP_NO_ERROR;
|
||||
Yap_PutException(Yap_GetFromSlot(exception));
|
||||
LOCAL_Error_TYPE = THROW_EVENT;
|
||||
LOCAL_ActiveError->errorGoal = Yap_TermToBuffer(Yap_GetFromHandle(exception), LOCAL_encoding, TermNil);
|
||||
//Yap_PutException(Yap_GetFromSlot(exception));
|
||||
Yap_RaiseException();
|
||||
return 0;
|
||||
}
|
||||
|
||||
X_API int PL_throw(term_t exception) {
|
||||
CACHE_REGS
|
||||
YAP_Throw(Yap_GetFromSlot(exception));
|
||||
if (LOCAL_execution)
|
||||
longjmp(LOCAL_execution->q_env, 0);
|
||||
return 0;
|
||||
return PL_raise_exception( exception );
|
||||
}
|
||||
|
||||
X_API void PL_fatal_error(const char *msg) {
|
||||
|
@ -943,7 +943,7 @@ static parser_state_t parseError(REnv *re, FEnv *fe, int inp_stream) {
|
||||
|
||||
Term t = syntax_error(fe->toklast, inp_stream, fe->cmod, re->cpos);
|
||||
if (ParserErrorStyle == TermError) {
|
||||
LOCAL_ActiveError->errorTerm = Yap_StoreTermInDB(t, 4);
|
||||
LOCAL_ActiveError->culprit = Yap_TermToBuffer(t, LOCAL_encoding, TermNil);
|
||||
LOCAL_Error_TYPE = SYNTAX_ERROR;
|
||||
// dec-10
|
||||
} else if (Yap_PrintWarning(t)) {
|
||||
@ -1374,19 +1374,31 @@ static Int style_checker(USES_REGS1) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Term Yap_BufferToTerm(const unsigned char *s, Term opts) {
|
||||
Term rval;
|
||||
int sno;
|
||||
encoding_t l = ENC_ISO_UTF8;
|
||||
sno = Yap_open_buf_read_stream((char *)s, strlen((const char *)s), &l,
|
||||
MEM_BUF_USER);
|
||||
Term Yap_BufferToTerm(const char *s, Term opts) {
|
||||
Term rval;
|
||||
int sno;
|
||||
encoding_t l = ENC_ISO_UTF8;
|
||||
sno = Yap_open_buf_read_stream((char *)s, strlen((const char *)s), &l,
|
||||
MEM_BUF_USER);
|
||||
|
||||
rval = Yap_read_term(sno, opts, false);
|
||||
Yap_CloseStream(sno);
|
||||
return rval;
|
||||
rval = Yap_read_term(sno, opts, false);
|
||||
Yap_CloseStream(sno);
|
||||
return rval;
|
||||
}
|
||||
|
||||
X_API Term Yap_BufferToTermWithPrioBindings(const unsigned char *s, Term opts, Term bindings, size_t len,
|
||||
Term Yap_UBufferToTerm(const unsigned char *s, Term opts) {
|
||||
Term rval;
|
||||
int sno;
|
||||
encoding_t l = ENC_ISO_UTF8;
|
||||
sno = Yap_open_buf_read_stream((char *)s, strlen((const char *)s), &l,
|
||||
MEM_BUF_USER);
|
||||
|
||||
rval = Yap_read_term(sno, opts, false);
|
||||
Yap_CloseStream(sno);
|
||||
return rval;
|
||||
}
|
||||
|
||||
X_API Term Yap_BufferToTermWithPrioBindings(const char *s, Term opts, Term bindings, size_t len,
|
||||
int prio) {
|
||||
CACHE_REGS
|
||||
Term ctl;
|
||||
@ -1434,7 +1446,7 @@ static Int read_term_from_atom(USES_REGS1) {
|
||||
}
|
||||
Term ctl = add_output(ARG2, ARG3);
|
||||
|
||||
return Yap_BufferToTerm(s, ctl);
|
||||
return Yap_UBufferToTerm(s, ctl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1468,7 +1480,7 @@ static Int read_term_from_atomic(USES_REGS1) {
|
||||
}
|
||||
Term ctl = add_output(ARG2, ARG3);
|
||||
|
||||
return Yap_BufferToTerm(s, ctl);
|
||||
return Yap_UBufferToTerm(s, ctl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1518,7 +1530,7 @@ static Int atomic_to_term(USES_REGS1) {
|
||||
} else {
|
||||
Term t = Yap_AtomicToString(t1 PASS_REGS);
|
||||
const unsigned char *us = UStringOfTerm(t);
|
||||
return Yap_BufferToTerm(us, add_output(ARG2, add_names(ARG3, TermNil)));
|
||||
return Yap_UBufferToTerm(us, add_output(ARG2, add_names(ARG3, TermNil)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1533,7 +1545,7 @@ static Int atom_to_term(USES_REGS1) {
|
||||
} else {
|
||||
Term t = Yap_AtomicToString(t1 PASS_REGS);
|
||||
const unsigned char *us = UStringOfTerm(t);
|
||||
return Yap_BufferToTerm(us, add_output(ARG2, add_names(ARG3, TermNil)));
|
||||
return Yap_UBufferToTerm(us, add_output(ARG2, add_names(ARG3, TermNil)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1548,7 +1560,7 @@ static Int string_to_term(USES_REGS1) {
|
||||
return (FALSE);
|
||||
} else {
|
||||
const unsigned char *us = UStringOfTerm(t1);
|
||||
return Yap_BufferToTerm(us, add_output(ARG2, add_names(ARG3, TermNil)));
|
||||
return Yap_UBufferToTerm(us, add_output(ARG2, add_names(ARG3, TermNil)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -715,7 +715,7 @@ static Int term_to_atom(USES_REGS1) {
|
||||
at = AtomOfTerm(t2);
|
||||
}
|
||||
ctl = TermNil;
|
||||
return ((rc = Yap_BufferToTerm(RepAtom(at)->UStrOfAE, ctl))) &&
|
||||
return ((rc = Yap_UBufferToTerm(RepAtom(at)->UStrOfAE, ctl))) &&
|
||||
Yap_unify(rc, ARG1);
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,9 @@ extern char *Yap_HandleToString(yhandle_t l, size_t sz, size_t *length,
|
||||
extern int Yap_GetFreeStreamD(void);
|
||||
extern int Yap_GetFreeStreamDForReading(void);
|
||||
|
||||
extern Term Yap_BufferToTerm(const char *s, Term opts);
|
||||
extern Term Yap_UBufferToTerm(const unsigned char *s, Term opts);
|
||||
|
||||
extern Term Yap_WStringToList(wchar_t *);
|
||||
extern Term Yap_WStringToListOfAtoms(wchar_t *);
|
||||
extern Atom Yap_LookupWideAtom(const wchar_t *);
|
||||
@ -116,9 +119,8 @@ extern int Yap_FormatFloat(Float f, char **s, size_t sz);
|
||||
extern int Yap_open_buf_read_stream(const char *buf, size_t nchars,
|
||||
encoding_t *encp, memBufSource src);
|
||||
extern int Yap_open_buf_write_stream(encoding_t enc, memBufSource src);
|
||||
extern Term Yap_BufferToTerm(const unsigned char *s, Term opts);
|
||||
extern X_API Term
|
||||
Yap_BufferToTermWithPrioBindings(const unsigned char *s, Term opts, Term bindings, size_t sz,
|
||||
extern Term Yap_BufferToTerm(const char *s, Term opts);
|
||||
extern X_API Term Yap_BufferToTermWithPrioBindings(const char *s, Term opts, Term bindings, size_t sz,
|
||||
int prio);
|
||||
extern FILE *Yap_GetInputStream(Term t, const char *m);
|
||||
extern FILE *Yap_GetOutputStream(Term t, const char *m);
|
||||
|
@ -1,465 +1,324 @@
|
||||
set (PYTHON_SOURCES backcall.py yap_kernel_launcher.py docs/conf.py
|
||||
yap_kernel/codeutil.py yap_kernel/comm yap_kernel/connect.py
|
||||
yap_kernel/datapub.py yap_kernel/displayhook.py
|
||||
yap_kernel/embed.py yap_kernel/_eventloop_macos.py
|
||||
yap_kernel/eventloops.py yap_kernel/gui yap_kernel/heartbeat.py
|
||||
yap_kernel/__init__.py yap_kernel/inprocess
|
||||
yap_kernel/iostream.py yap_kernel/ipkernel.py
|
||||
yap_kernel/jsonutil.py yap_kernel/kernelapp.py
|
||||
yap_kernel/kernelbase.py yap_kernel/kernelspec.py
|
||||
yap_kernel/log.py yap_kernel/__main__.py
|
||||
yap_kernel/parentpoller.py yap_kernel/pickleutil.py
|
||||
yap_kernel/pylab yap_kernel/serialize.py yap_kernel/tests
|
||||
yap_kernel/_version.py yap_kernel/zmqshell.py
|
||||
yap_ipython/config.py yap_ipython/consoleapp.py yap_ipython/core
|
||||
yap_ipython/display.py yap_ipython/extensions
|
||||
yap_ipython/external yap_ipython/frontend.py yap_ipython/html.py
|
||||
yap_ipython/__init__.py yap_ipython/kernel yap_ipython/lib
|
||||
yap_ipython/__main__.py yap_ipython/nbconvert.py
|
||||
yap_ipython/nbformat.py yap_ipython/parallel.py
|
||||
yap_ipython/paths.py yap_ipython/prolog yap_ipython/qt.py
|
||||
yap_ipython/sphinxext yap_ipython/terminal yap_ipython/testing
|
||||
yap_ipython/utils yap_ipython/yapi.py yap_kernel/comm/comm.py
|
||||
yap_kernel/comm/__init__.py yap_kernel/comm/manager.py
|
||||
yap_kernel/gui/gtk3embed.py yap_kernel/gui/gtkembed.py
|
||||
yap_kernel/gui/__init__.py yap_kernel/inprocess/blocking.py
|
||||
yap_kernel/inprocess/channels.py yap_kernel/inprocess/client.py
|
||||
yap_kernel/inprocess/constants.py
|
||||
yap_kernel/inprocess/__init__.py
|
||||
yap_kernel/inprocess/ipkernel.py yap_kernel/inprocess/manager.py
|
||||
yap_kernel/inprocess/socket.py yap_kernel/inprocess/tests
|
||||
yap_kernel/pylab/backend_inline.py yap_kernel/pylab/config.py
|
||||
yap_kernel/pylab/__init__.py yap_kernel/tests/_asyncio.py
|
||||
yap_kernel/tests/__init__.py yap_kernel/tests/test_connect.py
|
||||
yap_kernel/tests/test_embed_kernel.py
|
||||
yap_kernel/tests/test_eventloop.py yap_kernel/tests/test_io.py
|
||||
yap_kernel/tests/test_jsonutil.py
|
||||
yap_kernel/tests/test_kernel.py
|
||||
yap_kernel/tests/test_kernelspec.py
|
||||
yap_kernel/tests/test_message_spec.py
|
||||
yap_kernel/tests/test_pickleutil.py
|
||||
yap_kernel/tests/test_serialize.py
|
||||
yap_kernel/tests/test_start_kernel.py
|
||||
yap_kernel/tests/test_zmq_shell.py yap_kernel/tests/utils.py
|
||||
yap_ipython/core/alias.py yap_ipython/core/application.py
|
||||
yap_ipython/core/autocall.py yap_ipython/core/builtin_trap.py
|
||||
yap_ipython/core/compilerop.py yap_ipython/core/completerlib.py
|
||||
yap_ipython/core/completer.py yap_ipython/core/crashhandler.py
|
||||
yap_ipython/core/debugger.py yap_ipython/core/displayhook.py
|
||||
yap_ipython/core/displaypub.py yap_ipython/core/display.py
|
||||
yap_ipython/core/display_trap.py yap_ipython/core/error.py
|
||||
yap_ipython/core/events.py yap_ipython/core/excolors.py
|
||||
yap_ipython/core/extensions.py yap_ipython/core/formatters.py
|
||||
yap_ipython/core/getipython.py yap_ipython/core/historyapp.py
|
||||
yap_ipython/core/history.py yap_ipython/core/hooks.py
|
||||
yap_ipython/core/__init__.py yap_ipython/core/inputsplitter.py
|
||||
yap_ipython/core/inputtransformer.py
|
||||
yap_ipython/core/interactiveshell.py
|
||||
yap_ipython/core/latex_symbols.py yap_ipython/core/logger.py
|
||||
yap_ipython/core/macro.py yap_ipython/core/magic_arguments.py
|
||||
yap_ipython/core/magic.py yap_ipython/core/magics
|
||||
yap_ipython/core/oinspect.py yap_ipython/core/page.py
|
||||
yap_ipython/core/payloadpage.py yap_ipython/core/payload.py
|
||||
yap_ipython/core/prefilter.py yap_ipython/core/profileapp.py
|
||||
yap_ipython/core/profiledir.py yap_ipython/core/prompts.py
|
||||
yap_ipython/core/pylabtools.py yap_ipython/core/release.py
|
||||
yap_ipython/core/shellapp.py yap_ipython/core/splitinput.py
|
||||
yap_ipython/core/tests yap_ipython/core/ultratb.py
|
||||
yap_ipython/core/usage.py yap_ipython/extensions/autoreload.py
|
||||
yap_ipython/extensions/cythonmagic.py
|
||||
yap_ipython/extensions/__init__.py
|
||||
yap_ipython/extensions/rmagic.py
|
||||
yap_ipython/extensions/storemagic.py
|
||||
yap_ipython/extensions/sympyprinting.py
|
||||
yap_ipython/extensions/tests yap_ipython/external/decorators
|
||||
yap_ipython/external/__init__.py yap_ipython/external/mathjax.py
|
||||
yap_ipython/external/qt_for_kernel.py
|
||||
yap_ipython/external/qt_loaders.py yap_ipython/kernel/adapter.py
|
||||
yap_ipython/kernel/channelsabc.py yap_ipython/kernel/channels.py
|
||||
yap_ipython/kernel/clientabc.py yap_ipython/kernel/client.py
|
||||
yap_ipython/kernel/connect.py yap_ipython/kernel/__init__.py
|
||||
yap_ipython/kernel/kernelspecapp.py
|
||||
yap_ipython/kernel/kernelspec.py yap_ipython/kernel/launcher.py
|
||||
yap_ipython/kernel/__main__.py yap_ipython/kernel/managerabc.py
|
||||
yap_ipython/kernel/manager.py
|
||||
yap_ipython/kernel/multikernelmanager.py
|
||||
yap_ipython/kernel/restarter.py yap_ipython/kernel/threaded.py
|
||||
yap_ipython/lib/backgroundjobs.py yap_ipython/lib/clipboard.py
|
||||
yap_ipython/lib/deepreload.py yap_ipython/lib/demo.py
|
||||
yap_ipython/lib/display.py yap_ipython/lib/editorhooks.py
|
||||
yap_ipython/lib/guisupport.py yap_ipython/lib/__init__.py
|
||||
yap_ipython/lib/inputhookglut.py
|
||||
yap_ipython/lib/inputhookgtk3.py yap_ipython/lib/inputhookgtk.py
|
||||
yap_ipython/lib/inputhook.py yap_ipython/lib/inputhookpyglet.py
|
||||
yap_ipython/lib/inputhookqt4.py yap_ipython/lib/inputhookwx.py
|
||||
yap_ipython/lib/kernel.py yap_ipython/lib/latextools.py
|
||||
yap_ipython/lib/lexers.py yap_ipython/lib/pretty.py
|
||||
yap_ipython/lib/security.py yap_ipython/lib/tests
|
||||
yap_ipython/prolog/jupyter.yap
|
||||
yap_ipython/sphinxext/custom_doctests.py
|
||||
yap_ipython/sphinxext/__init__.py
|
||||
yap_ipython/sphinxext/ipython_console_highlighting.py
|
||||
yap_ipython/sphinxext/ipython_directive.py
|
||||
yap_ipython/terminal/console.py yap_ipython/terminal/debugger.py
|
||||
yap_ipython/terminal/embed.py yap_ipython/terminal/__init__.py
|
||||
yap_ipython/terminal/interactiveshell.py
|
||||
yap_ipython/terminal/ipapp.py yap_ipython/terminal/magics.py
|
||||
yap_ipython/terminal/prompts.py
|
||||
yap_ipython/terminal/pt_inputhooks
|
||||
yap_ipython/terminal/ptshell.py yap_ipython/terminal/ptutils.py
|
||||
yap_ipython/terminal/shortcuts.py yap_ipython/terminal/tests
|
||||
yap_ipython/testing/decorators.py
|
||||
yap_ipython/testing/globalipapp.py
|
||||
yap_ipython/testing/__init__.py
|
||||
yap_ipython/testing/iptestcontroller.py
|
||||
yap_ipython/testing/iptest.py yap_ipython/testing/ipunittest.py
|
||||
yap_ipython/testing/__main__.py yap_ipython/testing/plugin
|
||||
yap_ipython/testing/skipdoctest.py yap_ipython/testing/tests
|
||||
yap_ipython/testing/tools.py yap_ipython/utils/capture.py
|
||||
yap_ipython/utils/colorable.py yap_ipython/utils/coloransi.py
|
||||
yap_ipython/utils/contexts.py yap_ipython/utils/daemonize.py
|
||||
yap_ipython/utils/data.py yap_ipython/utils/decorators.py
|
||||
yap_ipython/utils/dir2.py yap_ipython/utils/encoding.py
|
||||
yap_ipython/utils/eventful.py yap_ipython/utils/frame.py
|
||||
yap_ipython/utils/generics.py yap_ipython/utils/importstring.py
|
||||
yap_ipython/utils/__init__.py yap_ipython/utils/io.py
|
||||
yap_ipython/utils/ipstruct.py yap_ipython/utils/jsonutil.py
|
||||
yap_ipython/utils/localinterfaces.py yap_ipython/utils/log.py
|
||||
yap_ipython/utils/module_paths.py yap_ipython/utils/openpy.py
|
||||
yap_ipython/utils/path.py yap_ipython/utils/pickleutil.py
|
||||
yap_ipython/utils/_process_cli.py
|
||||
yap_ipython/utils/_process_common.py
|
||||
yap_ipython/utils/_process_posix.py yap_ipython/utils/process.py
|
||||
yap_ipython/utils/_process_win32_controller.py
|
||||
yap_ipython/utils/_process_win32.py
|
||||
yap_ipython/utils/py3compat.py yap_ipython/utils/PyColorize.py
|
||||
yap_ipython/utils/sentinel.py yap_ipython/utils/shimmodule.py
|
||||
yap_ipython/utils/signatures.py yap_ipython/utils/strdispatch.py
|
||||
yap_ipython/utils/_sysinfo.py yap_ipython/utils/sysinfo.py
|
||||
yap_ipython/utils/syspathcontext.py yap_ipython/utils/tempdir.py
|
||||
yap_ipython/utils/terminal.py yap_ipython/utils/tests
|
||||
yap_ipython/utils/text.py yap_ipython/utils/timing.py
|
||||
yap_ipython/utils/tokenize2.py yap_ipython/utils/tokenutil.py
|
||||
yap_ipython/utils/traitlets.py yap_ipython/utils/tz.py
|
||||
yap_ipython/utils/ulinecache.py yap_ipython/utils/version.py
|
||||
yap_ipython/utils/wildcard.py
|
||||
yap_kernel/inprocess/tests/__init__.py
|
||||
yap_kernel/inprocess/tests/test_kernelmanager.py
|
||||
yap_kernel/inprocess/tests/test_kernel.py
|
||||
yap_ipython/core/magics/auto.py yap_ipython/core/magics/basic.py
|
||||
yap_ipython/core/magics/code.py
|
||||
yap_ipython/core/magics/config.py
|
||||
yap_ipython/core/magics/display.py
|
||||
yap_ipython/core/magics/execution.py
|
||||
yap_ipython/core/magics/extension.py
|
||||
yap_ipython/core/magics/history.py
|
||||
yap_ipython/core/magics/__init__.py
|
||||
yap_ipython/core/magics/logging.py
|
||||
yap_ipython/core/magics/namespace.py
|
||||
yap_ipython/core/magics/osm.py yap_ipython/core/magics/pylab.py
|
||||
yap_ipython/core/magics/script.py
|
||||
yap_ipython/core/tests/bad_all.py
|
||||
yap_ipython/core/tests/daft_extension
|
||||
yap_ipython/core/tests/__init__.py
|
||||
yap_ipython/core/tests/nonascii2.py
|
||||
yap_ipython/core/tests/nonascii.py
|
||||
yap_ipython/core/tests/print_argv.py
|
||||
yap_ipython/core/tests/refbug.py
|
||||
yap_ipython/core/tests/simpleerr.py
|
||||
yap_ipython/core/tests/tclass.py
|
||||
yap_ipython/core/tests/test_alias.py
|
||||
yap_ipython/core/tests/test_application.py
|
||||
yap_ipython/core/tests/test_autocall.py
|
||||
yap_ipython/core/tests/test_compilerop.py
|
||||
yap_ipython/core/tests/test_completerlib.py
|
||||
yap_ipython/core/tests/test_completer.py
|
||||
yap_ipython/core/tests/test_debugger.py
|
||||
yap_ipython/core/tests/test_displayhook.py
|
||||
yap_ipython/core/tests/test_display.py
|
||||
yap_ipython/core/tests/test_events.py
|
||||
yap_ipython/core/tests/test_extension.py
|
||||
yap_ipython/core/tests/test_formatters.py
|
||||
yap_ipython/core/tests/test_handlers.py
|
||||
yap_ipython/core/tests/test_history.py
|
||||
yap_ipython/core/tests/test_hooks.py
|
||||
yap_ipython/core/tests/test_imports.py
|
||||
yap_ipython/core/tests/test_inputsplitter.py
|
||||
yap_ipython/core/tests/test_inputtransformer.py
|
||||
yap_ipython/core/tests/test_interactiveshell.py
|
||||
yap_ipython/core/tests/test_iplib.py
|
||||
yap_ipython/core/tests/test_logger.py
|
||||
yap_ipython/core/tests/test_magic_arguments.py
|
||||
yap_ipython/core/tests/test_magic.py
|
||||
yap_ipython/core/tests/test_magic_terminal.py
|
||||
yap_ipython/core/tests/test_oinspect.py
|
||||
yap_ipython/core/tests/test_page.py
|
||||
yap_ipython/core/tests/test_paths.py
|
||||
yap_ipython/core/tests/test_prefilter.py
|
||||
yap_ipython/core/tests/test_profile.py
|
||||
yap_ipython/core/tests/test_prompts.py
|
||||
yap_ipython/core/tests/test_pylabtools.py
|
||||
yap_ipython/core/tests/test_run.py
|
||||
yap_ipython/core/tests/test_shellapp.py
|
||||
yap_ipython/core/tests/test_splitinput.py
|
||||
yap_ipython/core/tests/test_ultratb.py
|
||||
yap_ipython/extensions/tests/__init__.py
|
||||
yap_ipython/extensions/tests/test_autoreload.py
|
||||
yap_ipython/extensions/tests/test_storemagic.py
|
||||
yap_ipython/external/decorators/_decorators.py
|
||||
yap_ipython/external/decorators/__init__.py
|
||||
yap_ipython/external/decorators/_numpy_testing_noseclasses.py
|
||||
yap_ipython/lib/tests/__init__.py
|
||||
yap_ipython/lib/tests/test_backgroundjobs.py
|
||||
yap_ipython/lib/tests/test_clipboard.py
|
||||
yap_ipython/lib/tests/test_deepreload.py
|
||||
yap_ipython/lib/tests/test_display.py
|
||||
yap_ipython/lib/tests/test_editorhooks.py
|
||||
yap_ipython/lib/tests/test_imports.py
|
||||
yap_ipython/lib/tests/test_latextools.py
|
||||
yap_ipython/lib/tests/test_lexers.py
|
||||
yap_ipython/lib/tests/test_pretty.py
|
||||
yap_ipython/lib/tests/test_security.py
|
||||
yap_ipython/terminal/pt_inputhooks/glut.py
|
||||
yap_ipython/terminal/pt_inputhooks/gtk3.py
|
||||
yap_ipython/terminal/pt_inputhooks/gtk.py
|
||||
yap_ipython/terminal/pt_inputhooks/__init__.py
|
||||
yap_ipython/terminal/pt_inputhooks/osx.py
|
||||
yap_ipython/terminal/pt_inputhooks/pyglet.py
|
||||
yap_ipython/terminal/pt_inputhooks/qt.py
|
||||
yap_ipython/terminal/pt_inputhooks/tk.py
|
||||
yap_ipython/terminal/pt_inputhooks/wx.py
|
||||
yap_ipython/terminal/tests/__init__.py
|
||||
yap_ipython/terminal/tests/test_embed.py
|
||||
yap_ipython/terminal/tests/test_help.py
|
||||
yap_ipython/terminal/tests/test_interactivshell.py
|
||||
yap_ipython/testing/plugin/dtexample.py
|
||||
yap_ipython/testing/plugin/__init__.py
|
||||
yap_ipython/testing/plugin/ipdoctest.py
|
||||
yap_ipython/testing/plugin/iptest.py
|
||||
yap_ipython/testing/plugin/setup.py
|
||||
yap_ipython/testing/plugin/show_refs.py
|
||||
yap_ipython/testing/plugin/simple.py
|
||||
yap_ipython/testing/plugin/simplevars.py
|
||||
yap_ipython/testing/plugin/test_ipdoctest.py
|
||||
yap_ipython/testing/plugin/test_refs.py
|
||||
yap_ipython/testing/tests/__init__.py
|
||||
yap_ipython/testing/tests/test_decorators.py
|
||||
yap_ipython/testing/tests/test_ipunittest.py
|
||||
yap_ipython/testing/tests/test_tools.py
|
||||
yap_ipython/utils/tests/__init__.py
|
||||
yap_ipython/utils/tests/test_capture.py
|
||||
yap_ipython/utils/tests/test_decorators.py
|
||||
yap_ipython/utils/tests/test_dir2.py
|
||||
yap_ipython/utils/tests/test_imports.py
|
||||
yap_ipython/utils/tests/test_importstring.py
|
||||
yap_ipython/utils/tests/test_io.py
|
||||
yap_ipython/utils/tests/test_module_paths.py
|
||||
yap_ipython/utils/tests/test_openpy.py
|
||||
yap_ipython/utils/tests/test_path.py
|
||||
yap_ipython/utils/tests/test_process.py
|
||||
yap_ipython/utils/tests/test_pycolorize.py
|
||||
yap_ipython/utils/tests/test_shimmodule.py
|
||||
yap_ipython/utils/tests/test_sysinfo.py
|
||||
yap_ipython/utils/tests/test_tempdir.py
|
||||
yap_ipython/utils/tests/test_text.py
|
||||
yap_ipython/utils/tests/test_tokenutil.py
|
||||
yap_ipython/utils/tests/test_wildcard.py
|
||||
yap_ipython/core/tests/daft_extension/daft_extension.py
|
||||
__init__.py )
|
||||
|
||||
set (PYTHON_SOURCES
|
||||
backcall.py
|
||||
yap_kernel_launcher.py
|
||||
docs/conf.py
|
||||
yap_kernel/codeutil.py
|
||||
yap_kernel/comm
|
||||
yap_kernel/connect.py
|
||||
yap_kernel/datapub.py
|
||||
yap_kernel/displayhook.py
|
||||
yap_kernel/embed.py
|
||||
yap_kernel/_eventloop_macos.py
|
||||
yap_kernel/eventloops.py
|
||||
yap_kernel/gui
|
||||
yap_kernel/heartbeat.py
|
||||
yap_kernel/__init__.py
|
||||
yap_kernel/inprocess
|
||||
yap_kernel/iostream.py
|
||||
yap_kernel/ipkernel.py
|
||||
yap_kernel/jsonutil.py
|
||||
yap_kernel/kernelapp.py
|
||||
yap_kernel/kernelbase.py
|
||||
yap_kernel/kernelspec.py
|
||||
yap_kernel/log.py
|
||||
yap_kernel/__main__.py
|
||||
yap_kernel/parentpoller.py
|
||||
yap_kernel/pickleutil.py
|
||||
yap_kernel/pylab
|
||||
yap_kernel/serialize.py
|
||||
yap_kernel/tests
|
||||
yap_kernel/_version.py
|
||||
yap_kernel/zmqshell.py
|
||||
yap_ipython/config.py
|
||||
yap_ipython/consoleapp.py
|
||||
yap_ipython/core
|
||||
yap_ipython/display.py
|
||||
yap_ipython/extensions
|
||||
yap_ipython/external
|
||||
yap_ipython/frontend.py
|
||||
yap_ipython/html.py
|
||||
yap_ipython/__init__.py
|
||||
yap_ipython/kernel
|
||||
yap_ipython/lib
|
||||
yap_ipython/__main__.py
|
||||
yap_ipython/nbconvert.py
|
||||
yap_ipython/nbformat.py
|
||||
yap_ipython/parallel.py
|
||||
yap_ipython/paths.py
|
||||
yap_ipython/prolog
|
||||
yap_ipython/qt.py
|
||||
yap_ipython/sphinxext
|
||||
yap_ipython/terminal
|
||||
yap_ipython/testing
|
||||
yap_ipython/utils
|
||||
yap_ipython/yapi.py
|
||||
yap_kernel/comm/comm.py
|
||||
yap_kernel/comm/__init__.py
|
||||
yap_kernel/comm/manager.py
|
||||
yap_kernel/gui/gtk3embed.py
|
||||
yap_kernel/gui/gtkembed.py
|
||||
yap_kernel/gui/__init__.py
|
||||
yap_kernel/inprocess/blocking.py
|
||||
yap_kernel/inprocess/channels.py
|
||||
yap_kernel/inprocess/client.py
|
||||
yap_kernel/inprocess/constants.py
|
||||
yap_kernel/inprocess/__init__.py
|
||||
yap_kernel/inprocess/ipkernel.py
|
||||
yap_kernel/inprocess/manager.py
|
||||
yap_kernel/inprocess/socket.py
|
||||
yap_kernel/inprocess/tests
|
||||
yap_kernel/pylab/backend_inline.py
|
||||
yap_kernel/pylab/config.py
|
||||
yap_kernel/pylab/__init__.py
|
||||
yap_kernel/tests/_asyncio.py
|
||||
yap_kernel/tests/__init__.py
|
||||
yap_kernel/tests/test_connect.py
|
||||
yap_kernel/tests/test_embed_kernel.py
|
||||
yap_kernel/tests/test_eventloop.py
|
||||
yap_kernel/tests/test_io.py
|
||||
yap_kernel/tests/test_jsonutil.py
|
||||
yap_kernel/tests/test_kernel.py
|
||||
yap_kernel/tests/test_kernelspec.py
|
||||
yap_kernel/tests/test_message_spec.py
|
||||
yap_kernel/tests/test_pickleutil.py
|
||||
yap_kernel/tests/test_serialize.py
|
||||
yap_kernel/tests/test_start_kernel.py
|
||||
yap_kernel/tests/test_zmq_shell.py
|
||||
yap_kernel/tests/utils.py
|
||||
yap_ipython/core/alias.py
|
||||
yap_ipython/core/application.py
|
||||
yap_ipython/core/autocall.py
|
||||
yap_ipython/core/builtin_trap.py
|
||||
yap_ipython/core/compilerop.py
|
||||
yap_ipython/core/completerlib.py
|
||||
yap_ipython/core/completer.py
|
||||
yap_ipython/core/crashhandler.py
|
||||
yap_ipython/core/debugger.py
|
||||
yap_ipython/core/displayhook.py
|
||||
yap_ipython/core/displaypub.py
|
||||
yap_ipython/core/display.py
|
||||
yap_ipython/core/display_trap.py
|
||||
yap_ipython/core/error.py
|
||||
yap_ipython/core/events.py
|
||||
yap_ipython/core/excolors.py
|
||||
yap_ipython/core/extensions.py
|
||||
yap_ipython/core/formatters.py
|
||||
yap_ipython/core/getipython.py
|
||||
yap_ipython/core/historyapp.py
|
||||
yap_ipython/core/history.py
|
||||
yap_ipython/core/hooks.py
|
||||
yap_ipython/core/__init__.py
|
||||
yap_ipython/core/inputsplitter.py
|
||||
yap_ipython/core/inputtransformer.py
|
||||
yap_ipython/core/interactiveshell.py
|
||||
yap_ipython/core/latex_symbols.py
|
||||
yap_ipython/core/logger.py
|
||||
yap_ipython/core/macro.py
|
||||
yap_ipython/core/magic_arguments.py
|
||||
yap_ipython/core/magic.py
|
||||
yap_ipython/core/magics
|
||||
yap_ipython/core/oinspect.py
|
||||
yap_ipython/core/page.py
|
||||
yap_ipython/core/payloadpage.py
|
||||
yap_ipython/core/payload.py
|
||||
yap_ipython/core/prefilter.py
|
||||
yap_ipython/core/profileapp.py
|
||||
yap_ipython/core/profiledir.py
|
||||
yap_ipython/core/prompts.py
|
||||
yap_ipython/core/pylabtools.py
|
||||
yap_ipython/core/release.py
|
||||
yap_ipython/core/shellapp.py
|
||||
yap_ipython/core/splitinput.py
|
||||
yap_ipython/core/tests
|
||||
yap_ipython/core/ultratb.py
|
||||
yap_ipython/core/usage.py
|
||||
yap_ipython/extensions/autoreload.py
|
||||
yap_ipython/extensions/cythonmagic.py
|
||||
yap_ipython/extensions/__init__.py
|
||||
yap_ipython/extensions/rmagic.py
|
||||
yap_ipython/extensions/storemagic.py
|
||||
yap_ipython/extensions/sympyprinting.py
|
||||
yap_ipython/extensions/tests
|
||||
yap_ipython/external/decorators
|
||||
yap_ipython/external/__init__.py
|
||||
yap_ipython/external/mathjax.py
|
||||
yap_ipython/external/qt_for_kernel.py
|
||||
yap_ipython/external/qt_loaders.py
|
||||
yap_ipython/kernel/adapter.py
|
||||
yap_ipython/kernel/channelsabc.py
|
||||
yap_ipython/kernel/channels.py
|
||||
yap_ipython/kernel/clientabc.py
|
||||
yap_ipython/kernel/client.py
|
||||
yap_ipython/kernel/connect.py
|
||||
yap_ipython/kernel/__init__.py
|
||||
yap_ipython/kernel/kernelspecapp.py
|
||||
yap_ipython/kernel/kernelspec.py
|
||||
yap_ipython/kernel/launcher.py
|
||||
yap_ipython/kernel/__main__.py
|
||||
yap_ipython/kernel/managerabc.py
|
||||
yap_ipython/kernel/manager.py
|
||||
yap_ipython/kernel/multikernelmanager.py
|
||||
yap_ipython/kernel/restarter.py
|
||||
yap_ipython/kernel/threaded.py
|
||||
yap_ipython/lib/backgroundjobs.py
|
||||
yap_ipython/lib/clipboard.py
|
||||
yap_ipython/lib/deepreload.py
|
||||
yap_ipython/lib/demo.py
|
||||
yap_ipython/lib/display.py
|
||||
yap_ipython/lib/editorhooks.py
|
||||
yap_ipython/lib/guisupport.py
|
||||
yap_ipython/lib/__init__.py
|
||||
yap_ipython/lib/inputhookglut.py
|
||||
yap_ipython/lib/inputhookgtk3.py
|
||||
yap_ipython/lib/inputhookgtk.py
|
||||
yap_ipython/lib/inputhook.py
|
||||
yap_ipython/lib/inputhookpyglet.py
|
||||
yap_ipython/lib/inputhookqt4.py
|
||||
yap_ipython/lib/inputhookwx.py
|
||||
yap_ipython/lib/kernel.py
|
||||
yap_ipython/lib/latextools.py
|
||||
yap_ipython/lib/lexers.py
|
||||
yap_ipython/lib/pretty.py
|
||||
yap_ipython/lib/security.py
|
||||
yap_ipython/lib/tests
|
||||
yap_ipython/prolog/jupyter.yap
|
||||
yap_ipython/sphinxext/custom_doctests.py
|
||||
yap_ipython/sphinxext/__init__.py
|
||||
yap_ipython/sphinxext/ipython_console_highlighting.py
|
||||
yap_ipython/sphinxext/ipython_directive.py
|
||||
yap_ipython/terminal/console.py
|
||||
yap_ipython/terminal/debugger.py
|
||||
yap_ipython/terminal/embed.py
|
||||
yap_ipython/terminal/__init__.py
|
||||
yap_ipython/terminal/interactiveshell.py
|
||||
yap_ipython/terminal/ipapp.py
|
||||
yap_ipython/terminal/magics.py
|
||||
yap_ipython/terminal/prompts.py
|
||||
yap_ipython/terminal/pt_inputhooks
|
||||
yap_ipython/terminal/ptshell.py
|
||||
yap_ipython/terminal/ptutils.py
|
||||
yap_ipython/terminal/shortcuts.py
|
||||
yap_ipython/terminal/tests
|
||||
yap_ipython/testing/decorators.py
|
||||
yap_ipython/testing/globalipapp.py
|
||||
yap_ipython/testing/__init__.py
|
||||
yap_ipython/testing/iptestcontroller.py
|
||||
yap_ipython/testing/iptest.py
|
||||
yap_ipython/testing/ipunittest.py
|
||||
yap_ipython/testing/__main__.py
|
||||
yap_ipython/testing/plugin
|
||||
yap_ipython/testing/skipdoctest.py
|
||||
yap_ipython/testing/tests
|
||||
yap_ipython/testing/tools.py
|
||||
yap_ipython/utils/capture.py
|
||||
yap_ipython/utils/colorable.py
|
||||
yap_ipython/utils/coloransi.py
|
||||
yap_ipython/utils/contexts.py
|
||||
yap_ipython/utils/daemonize.py
|
||||
yap_ipython/utils/data.py
|
||||
yap_ipython/utils/decorators.py
|
||||
yap_ipython/utils/dir2.py
|
||||
yap_ipython/utils/encoding.py
|
||||
yap_ipython/utils/eventful.py
|
||||
yap_ipython/utils/frame.py
|
||||
yap_ipython/utils/generics.py
|
||||
yap_ipython/utils/importstring.py
|
||||
yap_ipython/utils/__init__.py
|
||||
yap_ipython/utils/io.py
|
||||
yap_ipython/utils/ipstruct.py
|
||||
yap_ipython/utils/jsonutil.py
|
||||
yap_ipython/utils/localinterfaces.py
|
||||
yap_ipython/utils/log.py
|
||||
yap_ipython/utils/module_paths.py
|
||||
yap_ipython/utils/openpy.py
|
||||
yap_ipython/utils/path.py
|
||||
yap_ipython/utils/pickleutil.py
|
||||
yap_ipython/utils/_process_cli.py
|
||||
yap_ipython/utils/_process_common.py
|
||||
yap_ipython/utils/_process_posix.py
|
||||
yap_ipython/utils/process.py
|
||||
yap_ipython/utils/_process_win32_controller.py
|
||||
yap_ipython/utils/_process_win32.py
|
||||
yap_ipython/utils/py3compat.py
|
||||
yap_ipython/utils/PyColorize.py
|
||||
yap_ipython/utils/sentinel.py
|
||||
yap_ipython/utils/shimmodule.py
|
||||
yap_ipython/utils/signatures.py
|
||||
yap_ipython/utils/strdispatch.py
|
||||
yap_ipython/utils/_sysinfo.py
|
||||
yap_ipython/utils/sysinfo.py
|
||||
yap_ipython/utils/syspathcontext.py
|
||||
yap_ipython/utils/tempdir.py
|
||||
yap_ipython/utils/terminal.py
|
||||
yap_ipython/utils/tests
|
||||
yap_ipython/utils/text.py
|
||||
yap_ipython/utils/timing.py
|
||||
yap_ipython/utils/tokenize2.py
|
||||
yap_ipython/utils/tokenutil.py
|
||||
yap_ipython/utils/traitlets.py
|
||||
yap_ipython/utils/tz.py
|
||||
yap_ipython/utils/ulinecache.py
|
||||
yap_ipython/utils/version.py
|
||||
yap_ipython/utils/wildcard.py
|
||||
yap_kernel/inprocess/tests/__init__.py
|
||||
yap_kernel/inprocess/tests/test_kernelmanager.py
|
||||
yap_kernel/inprocess/tests/test_kernel.py
|
||||
yap_ipython/core/magics/auto.py
|
||||
yap_ipython/core/magics/basic.py
|
||||
yap_ipython/core/magics/code.py
|
||||
yap_ipython/core/magics/config.py
|
||||
yap_ipython/core/magics/display.py
|
||||
yap_ipython/core/magics/execution.py
|
||||
yap_ipython/core/magics/extension.py
|
||||
yap_ipython/core/magics/history.py
|
||||
yap_ipython/core/magics/__init__.py
|
||||
yap_ipython/core/magics/logging.py
|
||||
yap_ipython/core/magics/namespace.py
|
||||
yap_ipython/core/magics/osm.py
|
||||
yap_ipython/core/magics/pylab.py
|
||||
yap_ipython/core/magics/script.py
|
||||
yap_ipython/core/tests/bad_all.py
|
||||
yap_ipython/core/tests/daft_extension
|
||||
yap_ipython/core/tests/__init__.py
|
||||
yap_ipython/core/tests/nonascii2.py
|
||||
yap_ipython/core/tests/nonascii.py
|
||||
yap_ipython/core/tests/print_argv.py
|
||||
yap_ipython/core/tests/refbug.py
|
||||
yap_ipython/core/tests/simpleerr.py
|
||||
yap_ipython/core/tests/tclass.py
|
||||
yap_ipython/core/tests/test_alias.py
|
||||
yap_ipython/core/tests/test_application.py
|
||||
yap_ipython/core/tests/test_autocall.py
|
||||
yap_ipython/core/tests/test_compilerop.py
|
||||
yap_ipython/core/tests/test_completerlib.py
|
||||
yap_ipython/core/tests/test_completer.py
|
||||
yap_ipython/core/tests/test_debugger.py
|
||||
yap_ipython/core/tests/test_displayhook.py
|
||||
yap_ipython/core/tests/test_display.py
|
||||
yap_ipython/core/tests/test_events.py
|
||||
yap_ipython/core/tests/test_extension.py
|
||||
yap_ipython/core/tests/test_formatters.py
|
||||
yap_ipython/core/tests/test_handlers.py
|
||||
yap_ipython/core/tests/test_history.py
|
||||
yap_ipython/core/tests/test_hooks.py
|
||||
yap_ipython/core/tests/test_imports.py
|
||||
yap_ipython/core/tests/test_inputsplitter.py
|
||||
yap_ipython/core/tests/test_inputtransformer.py
|
||||
yap_ipython/core/tests/test_interactiveshell.py
|
||||
yap_ipython/core/tests/test_iplib.py
|
||||
yap_ipython/core/tests/test_logger.py
|
||||
yap_ipython/core/tests/test_magic_arguments.py
|
||||
yap_ipython/core/tests/test_magic.py
|
||||
yap_ipython/core/tests/test_magic_terminal.py
|
||||
yap_ipython/core/tests/test_oinspect.py
|
||||
yap_ipython/core/tests/test_page.py
|
||||
yap_ipython/core/tests/test_paths.py
|
||||
yap_ipython/core/tests/test_prefilter.py
|
||||
yap_ipython/core/tests/test_profile.py
|
||||
yap_ipython/core/tests/test_prompts.py
|
||||
yap_ipython/core/tests/test_pylabtools.py
|
||||
yap_ipython/core/tests/test_run.py
|
||||
yap_ipython/core/tests/test_shellapp.py
|
||||
yap_ipython/core/tests/test_splitinput.py
|
||||
yap_ipython/core/tests/test_ultratb.py
|
||||
yap_ipython/extensions/tests/__init__.py
|
||||
yap_ipython/extensions/tests/test_autoreload.py
|
||||
yap_ipython/extensions/tests/test_storemagic.py
|
||||
yap_ipython/external/decorators/_decorators.py
|
||||
yap_ipython/external/decorators/__init__.py
|
||||
yap_ipython/external/decorators/_numpy_testing_noseclasses.py
|
||||
yap_ipython/lib/tests/__init__.py
|
||||
yap_ipython/lib/tests/test_backgroundjobs.py
|
||||
yap_ipython/lib/tests/test_clipboard.py
|
||||
yap_ipython/lib/tests/test_deepreload.py
|
||||
yap_ipython/lib/tests/test_display.py
|
||||
yap_ipython/lib/tests/test_editorhooks.py
|
||||
yap_ipython/lib/tests/test_imports.py
|
||||
yap_ipython/lib/tests/test_latextools.py
|
||||
yap_ipython/lib/tests/test_lexers.py
|
||||
yap_ipython/lib/tests/test_pretty.py
|
||||
yap_ipython/lib/tests/test_security.py
|
||||
yap_ipython/terminal/pt_inputhooks/glut.py
|
||||
yap_ipython/terminal/pt_inputhooks/gtk3.py
|
||||
yap_ipython/terminal/pt_inputhooks/gtk.py
|
||||
yap_ipython/terminal/pt_inputhooks/__init__.py
|
||||
yap_ipython/terminal/pt_inputhooks/osx.py
|
||||
yap_ipython/terminal/pt_inputhooks/pyglet.py
|
||||
yap_ipython/terminal/pt_inputhooks/qt.py
|
||||
yap_ipython/terminal/pt_inputhooks/tk.py
|
||||
yap_ipython/terminal/pt_inputhooks/wx.py
|
||||
yap_ipython/terminal/tests/__init__.py
|
||||
yap_ipython/terminal/tests/test_embed.py
|
||||
yap_ipython/terminal/tests/test_help.py
|
||||
yap_ipython/terminal/tests/test_interactivshell.py
|
||||
yap_ipython/testing/plugin/dtexample.py
|
||||
yap_ipython/testing/plugin/__init__.py
|
||||
yap_ipython/testing/plugin/ipdoctest.py
|
||||
yap_ipython/testing/plugin/iptest.py
|
||||
yap_ipython/testing/plugin/setup.py
|
||||
yap_ipython/testing/plugin/show_refs.py
|
||||
yap_ipython/testing/plugin/simple.py
|
||||
yap_ipython/testing/plugin/simplevars.py
|
||||
yap_ipython/testing/plugin/test_ipdoctest.py
|
||||
yap_ipython/testing/plugin/test_refs.py
|
||||
yap_ipython/testing/tests/__init__.py
|
||||
yap_ipython/testing/tests/test_decorators.py
|
||||
yap_ipython/testing/tests/test_ipunittest.py
|
||||
yap_ipython/testing/tests/test_tools.py
|
||||
yap_ipython/utils/tests/__init__.py
|
||||
yap_ipython/utils/tests/test_capture.py
|
||||
yap_ipython/utils/tests/test_decorators.py
|
||||
yap_ipython/utils/tests/test_dir2.py
|
||||
yap_ipython/utils/tests/test_imports.py
|
||||
yap_ipython/utils/tests/test_importstring.py
|
||||
yap_ipython/utils/tests/test_io.py
|
||||
yap_ipython/utils/tests/test_module_paths.py
|
||||
yap_ipython/utils/tests/test_openpy.py
|
||||
yap_ipython/utils/tests/test_path.py
|
||||
yap_ipython/utils/tests/test_process.py
|
||||
yap_ipython/utils/tests/test_pycolorize.py
|
||||
yap_ipython/utils/tests/test_shimmodule.py
|
||||
yap_ipython/utils/tests/test_sysinfo.py
|
||||
yap_ipython/utils/tests/test_tempdir.py
|
||||
yap_ipython/utils/tests/test_text.py
|
||||
yap_ipython/utils/tests/test_tokenutil.py
|
||||
yap_ipython/utils/tests/test_wildcard.py
|
||||
yap_ipython/core/tests/daft_extension/daft_extension.py
|
||||
__init__.py
|
||||
set (EXTRAS MANIFEST.in YAP_KERNEL.md setup.py setup.cfg README.md )
|
||||
|
||||
)
|
||||
set (RESOURCES
|
||||
#yap_kernel/resources/logo-32x32.png
|
||||
#yap_kernel/resourcess/logo-64x64.png
|
||||
)
|
||||
|
||||
set (EXTRAS
|
||||
MANIFEST.in
|
||||
YAP_KERNEL.md
|
||||
setup.py
|
||||
setup.cfg
|
||||
README.md
|
||||
)
|
||||
set (RENAMED_RESOURCES
|
||||
yap_kernel/resources/logo-32x32.png
|
||||
yap_kernel/resources/logo-64x64.png
|
||||
# yap_kernel/resources/codemirror/mode/prolog/prolog.js
|
||||
)
|
||||
|
||||
set (RESOURCES
|
||||
#yap_kernel/resources/logo-32x32.png
|
||||
#yap_kernel/resourcess/logo-64x64.png
|
||||
)
|
||||
set (RENAMED_RESOURCES
|
||||
|
||||
yap_kernel/resources/logo-32x32.png
|
||||
|
||||
yap_kernel/resources/logo-64x64.png
|
||||
#
|
||||
yap_kernel/resources/codemirror/mode/prolog/prolog.js
|
||||
)
|
||||
|
||||
set (PL_SOURCES
|
||||
|
||||
yap_ipython/prolog/jupyter.yap
|
||||
)
|
||||
set (PL_SOURCES yap_ipython/prolog/jupyter.yap)
|
||||
|
||||
set(FILES ${PYTHON_SOURCES} ${PL_SOURCES} ${EXTRAS} ${RESOURCES})
|
||||
|
||||
set(SETUP_PY ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
|
||||
set(SETUP_PY ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap.tgz
|
||||
COMMAND ${CMAKE_COMMAND} -E tar cf ${CMAKE_CURRENT_BINARY_DIR}/yap.tgz ${FILES}
|
||||
|
||||
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS ${FILES}
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap.tgz
|
||||
COMMAND ${CMAKE_COMMAND} -E tar czf ${CMAKE_CURRENT_BINARY_DIR}/yap.tgz ${FILES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS ${FILES}
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-32x32.png
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
yap_kernel/resources
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/docs/icons/yap_32x32x32.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-32x32.png
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/docs/icons/yap_32x32x32.png
|
||||
)
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory yap_kernel/resources
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/docs/icons/yap_32x32x32.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-32x32.png
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/docs/icons/yap_32x32x32.png
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-64x64.png
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/docs/icons/yap_64x64x32.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-64x64.png
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/docs/icons/yap_64x64x32.png
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-64x64.png
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/docs/icons/yap_64x64x32.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-64x64.png
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/docs/icons/yap_64x64x32.png
|
||||
)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/kernel.js
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/kernel.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/kernel.js
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/misc/editors/yap.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/misc/editors/yap.js
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/kernel.js
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/kernel.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/kernel.js
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/misc/editors/yap.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/misc/editors/yap.js
|
||||
)
|
||||
|
||||
add_custom_target(YAP_KERNEL ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf
|
||||
yap.tgz
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-32x32.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-64x64.png
|
||||
yap.tgz ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/kernel.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
||||
)
|
||||
add_custom_target(YAP_KERNEL ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf yap.tgz
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-32x32.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-64x64.png yap.tgz ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/kernel.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
||||
)
|
||||
|
||||
|
||||
install(CODE "execute_process(
|
||||
|
@ -17,7 +17,94 @@
|
||||
<DistClean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="libxml2">
|
||||
<Option output="/home/vsc/github/yap-6.3/packages/raptor/libxml2.so" prefix_auto="0" extension_auto="0"/>
|
||||
<Option working_dir="/home/vsc/github/yap-6.3/packages/raptor"/>
|
||||
<Option object_output="./"/>
|
||||
<Option type="3"/>
|
||||
<Option compiler="clang"/>
|
||||
<Compiler>
|
||||
<Add option="-DDEPTH_LIMIT=1"/>
|
||||
<Add option="-DCOROUTINING=1"/>
|
||||
<Add option="-DRATIONAL_TREES=1"/>
|
||||
<Add option="-D_YAP_NOT_INSTALLED_=1"/>
|
||||
<Add option="-DHAVE_CONFIG_H=1"/>
|
||||
<Add option="-D_GNU_SOURCE"/>
|
||||
<Add option="-DDEBUG=1"/>
|
||||
<Add option="-DTHREADED_CODE=1"/>
|
||||
<Add option="-DLOW_LEVEL_TRACER=1"/>
|
||||
<Add option="-DUTF8PROC=1"/>
|
||||
<Add option="-DUSE_MYDDAS=1"/>
|
||||
<Add option="-DMYDDAS_SQLITE3=1"/>
|
||||
<Add option="-DTABLING=1"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3"/>
|
||||
<Add directory="/usr/include/x86_64-linux-gnu"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/utf8proc"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/myddas"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/H"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/H/generated"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/include"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/os"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/OPTYap"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/JIT/HPP"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/raptor/../../H"/>
|
||||
<Add directory="/home/vsc/anaconda3/conda-bld/yap4py_1522051601517/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/libxml2"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/raptor"/>
|
||||
</Compiler>
|
||||
<MakeCommands>
|
||||
<Build command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 libxml2"/>
|
||||
<CompileFile command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="libxml2/fast">
|
||||
<Option output="/home/vsc/github/yap-6.3/packages/raptor/libxml2.so" prefix_auto="0" extension_auto="0"/>
|
||||
<Option working_dir="/home/vsc/github/yap-6.3/packages/raptor"/>
|
||||
<Option object_output="./"/>
|
||||
<Option type="3"/>
|
||||
<Option compiler="clang"/>
|
||||
<Compiler>
|
||||
<Add option="-DDEPTH_LIMIT=1"/>
|
||||
<Add option="-DCOROUTINING=1"/>
|
||||
<Add option="-DRATIONAL_TREES=1"/>
|
||||
<Add option="-D_YAP_NOT_INSTALLED_=1"/>
|
||||
<Add option="-DHAVE_CONFIG_H=1"/>
|
||||
<Add option="-D_GNU_SOURCE"/>
|
||||
<Add option="-DDEBUG=1"/>
|
||||
<Add option="-DTHREADED_CODE=1"/>
|
||||
<Add option="-DLOW_LEVEL_TRACER=1"/>
|
||||
<Add option="-DUTF8PROC=1"/>
|
||||
<Add option="-DUSE_MYDDAS=1"/>
|
||||
<Add option="-DMYDDAS_SQLITE3=1"/>
|
||||
<Add option="-DTABLING=1"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3"/>
|
||||
<Add directory="/usr/include/x86_64-linux-gnu"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/utf8proc"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/myddas"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/myddas/sqlite3/src"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/H"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/H/generated"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/include"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/os"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/OPTYap"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/JIT/HPP"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/raptor/../../H"/>
|
||||
<Add directory="/home/vsc/anaconda3/conda-bld/yap4py_1522051601517/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/include/libxml2"/>
|
||||
<Add directory="/home/vsc/github/yap-6.3/packages/raptor"/>
|
||||
</Compiler>
|
||||
<MakeCommands>
|
||||
<Build command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 libxml2/fast"/>
|
||||
<CompileFile command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="/usr/bin/make -f "/home/vsc/github/yap-6.3/packages/raptor/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
</Build>
|
||||
<Unit filename="/home/vsc/github/yap-6.3/packages/raptor/xml2_yap.c">
|
||||
<Option target="libxml2"/>
|
||||
</Unit>
|
||||
<Unit filename="/home/vsc/github/yap-6.3/CMakeLists.txt">
|
||||
<Option virtualFolder="CMake Files\"/>
|
||||
</Unit>
|
||||
|
Reference in New Issue
Block a user