This commit is contained in:
Vitor Santos Costa 2018-07-12 15:17:01 +01:00
parent 4de58e0fe4
commit 4fff363436
5 changed files with 13 additions and 10 deletions

View File

@ -532,8 +532,10 @@ unsigned char *Yap_readText(seq_tv_t *inp USES_REGS) {
} }
#endif #endif
if (inp->type & YAP_STRING_TERM) { if (inp->type & YAP_STRING_TERM) {
// Yap_DebugPlWriteln(inp->val.t); // Yap_DebugPlWriteln(inp->val.t
char *s = (char *)Yap_TermToBuffer(inp->val.t, 0); return inp->val.c = (char *)Yap_TermToBuffer(inp->val.t, 0);
pop_text_stack(lvl);
return inp->val.c;
} }
if (inp->type & YAP_STRING_CHARS) { if (inp->type & YAP_STRING_CHARS) {
pop_text_stack(lvl); pop_text_stack(lvl);

View File

@ -203,13 +203,13 @@ static bool consult(const char *b_file USES_REGS) {
} else { } else {
YAP_CompileClause(t); YAP_CompileClause(t);
} }
} while (true);
yap_error_descriptor_t *errd; yap_error_descriptor_t *errd;
if ((errd = if ((errd =
Yap_GetException(LOCAL_ActiveError))) { Yap_GetException(LOCAL_ActiveError))) {
fprintf(stderr, "%s:%ld:0: Error %s %s Found\n", errd->errorFile, (long int) errd->errorLine, errd->classAsText, fprintf(stderr, "%s:%ld:0: Error %s %s Found\n", errd->errorFile, (long int) errd->errorLine, errd->classAsText,
errd->errorAsText); errd->errorAsText);
} }
} while (true);
BACKUP_MACHINE_REGS(); BACKUP_MACHINE_REGS();
YAP_EndConsult(c_stream, &osno, full); YAP_EndConsult(c_stream, &osno, full);
if (!Yap_AddAlias(AtomLoopStream, osno)) { if (!Yap_AddAlias(AtomLoopStream, osno)) {

View File

@ -519,7 +519,7 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) {
#if YAP_PYTHON #if YAP_PYTHON
// PyThreadState *_save; // PyThreadState *_save;
std::cerr << "mgoal " << YAPTerm(t).text() << "\n"; //std::cerr << "mgoal " << YAPTerm(t).text() << "\n";
// _save = PyEval_SaveThread(); // _save = PyEval_SaveThread();
#endif #endif
CACHE_REGS CACHE_REGS
@ -553,7 +553,7 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) {
//__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); //__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec ");
result = (bool)YAP_EnterGoal(ap, nullptr, &q); result = (bool)YAP_EnterGoal(ap, nullptr, &q);
std::cerr << "mgoal " << YAPTerm(t).text() << "\n"; //std::cerr << "mgoal " << YAPTerm(t).text() << "\n";
YAP_LeaveGoal(result && !release, &q); YAP_LeaveGoal(result && !release, &q);
// PyEval_RestoreThread(_save); // PyEval_RestoreThread(_save);

View File

@ -41,7 +41,6 @@ jupyter_cell( Caller, _, Line ) :-
E=error(A,B), E=error(A,B),
system_error(A,B) system_error(A,B)
). ).
jupyter_cell(_,_,_).
restreams(call) :- restreams(call) :-
streams(true). streams(true).
@ -207,4 +206,4 @@ plot_inline :-
:- endif. :- endif.
:- ( start_low_level_trace ). %:- ( start_low_level_trace ).

View File

@ -121,9 +121,11 @@ print_message(L,E) :-
). ).
'$undefp0'([M|G], _Action) :- '$undefp0'([M|G], _Action) :-
stream_property( loop_stream, file_name(F)), stream_property( loop_stream, [file_name(F), line_number(L)]),
stream_property( loop_stream, line_number(L)), format(user_error,'~a:~d error undefined:',[F,L]),
format(user_error,'~a:~d error undefined: call to ~w~n',[F,L,M:G]), fail
;
format(user_error,' call to ~w~n',[M:G]),
fail. fail.
:- '$undefp_handler'('$undefp0'(_,_),prolog). :- '$undefp_handler'('$undefp0'(_,_),prolog).