Merge branch 'master' of github.com:vscosta/yap-6.3

This commit is contained in:
Vitor Santos Costa 2018-07-04 11:24:46 +01:00
commit 8e43a02789
5 changed files with 17 additions and 4 deletions

View File

@ -95,8 +95,8 @@ static bool setErr(const char *q, yap_error_descriptor_t *i, Term t) {
}
#define query_key_s(k, ks, q, i) \
if (strcmp(ks, q) == 0) { \
return MkAtomTerm(Yap_LookupAtom(i->k)); }
if (strcmp(ks, q) == 0 && i->k) { \
return MkAtomTerm(Yap_LookupAtom(i->k)); } else {return TermNil;}
#define query_key_t(k, ks, q, i) \
if (strcmp(ks, q) == 0) { \
@ -986,8 +986,11 @@ static Int reset_exception(USES_REGS1) { return Yap_ResetException(worker_id); }
Term MkErrorTerm(yap_error_descriptor_t *t) {
if (t->errorClass == EVENT)
return t->errorRawTerm;
Term tc = t->culprit ? Yap_BufferToTerm(t->culprit, TermNil) : TermNil;
if (tc == 0)
tc = MkAtomTerm(Yap_LookupAtom(t->culprit));
return mkerrort(t->errorNo,
t->culprit ? Yap_BufferToTerm(t->culprit, TermNil) : TermNil,
tc,
err2list(t));
}

View File

@ -117,7 +117,7 @@ public:
/// numbervars ( int start, bool process=false )
intptr_t numberVars(intptr_t start, bool skip_singletons = false);
inline Term term() {
return gt();
return Deref(gt());
} /// from YAPTerm to Term (internal YAP representation)
YAPTerm arg(int i) {
BACKUP_MACHINE_REGS();

View File

@ -159,6 +159,12 @@ opportunity. Initial value is 10,000. May be changed. A value of 0
NULL),
YAP_FLAG(DEBUGGER_SHOW_CONTEXT_FLAG, "debugger_show_context", true,
booleanFlag, "false", NULL),
YAP_FLAG(DEFAULT_PARENT_MODULE_FLAG, "default_parent_module", true, isatom, "user", NULL),
/**<
* A module to be inherited by all other modules. Default is user that reexports prolog.
*
* Set it to `prolog` for SICStus Prolog like resolution, to `user` for SWI-like.
*/
YAP_FLAG(DIALECT_FLAG, "dialect", false, ro, "yap", NULL),
/**<

View File

@ -181,6 +181,7 @@
member/2
]).
:- set(verbose,silent).

View File

@ -38,6 +38,9 @@
'$get_undefined_predicates'(G, ImportingMod, G0, ExportingMod) :-
'$parent_module'(ImportingMod,ExportingModI),
'$continue_imported'(ExportingMod, ExportingModI, G0, G).
'$get_undefined_predicates'(G, ImportingMod, G0, ExportingMod) :-
yap_flag(default_parent_module,ExportingModI),
'$continue_imported'(ExportingMod, ExportingModI, G0, G).
'$get_undefined_pred'(G, ImportingMod, G0, ExportingMod) :-
'$get_undefined_predicates'(G, ImportingMod, G0, ExportingMod),