diff --git a/C/text.c b/C/text.c index 5f225cde7..af2cfeee4 100644 --- a/C/text.c +++ b/C/text.c @@ -532,8 +532,10 @@ unsigned char *Yap_readText(seq_tv_t *inp USES_REGS) { } #endif if (inp->type & YAP_STRING_TERM) { - // Yap_DebugPlWriteln(inp->val.t); - char *s = (char *)Yap_TermToBuffer(inp->val.t, 0); + // Yap_DebugPlWriteln(inp->val.t + 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) { pop_text_stack(lvl); diff --git a/C/yap-args.c b/C/yap-args.c index b1abc3ae9..e7be80153 100755 --- a/C/yap-args.c +++ b/C/yap-args.c @@ -203,13 +203,13 @@ static bool consult(const char *b_file USES_REGS) { } else { YAP_CompileClause(t); } - } while (true); yap_error_descriptor_t *errd; if ((errd = Yap_GetException(LOCAL_ActiveError))) { fprintf(stderr, "%s:%ld:0: Error %s %s Found\n", errd->errorFile, (long int) errd->errorLine, errd->classAsText, errd->errorAsText); } + } while (true); BACKUP_MACHINE_REGS(); YAP_EndConsult(c_stream, &osno, full); if (!Yap_AddAlias(AtomLoopStream, osno)) { diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index 3d9e0d9df..d955eada6 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -519,7 +519,7 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) { #if YAP_PYTHON // PyThreadState *_save; - std::cerr << "mgoal " << YAPTerm(t).text() << "\n"; + //std::cerr << "mgoal " << YAPTerm(t).text() << "\n"; // _save = PyEval_SaveThread(); #endif CACHE_REGS @@ -553,7 +553,7 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) { //__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); 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); // PyEval_RestoreThread(_save); diff --git a/packages/python/yap_kernel/yap_ipython/prolog/jupyter.yap b/packages/python/yap_kernel/yap_ipython/prolog/jupyter.yap index c758bcf40..c82125571 100644 --- a/packages/python/yap_kernel/yap_ipython/prolog/jupyter.yap +++ b/packages/python/yap_kernel/yap_ipython/prolog/jupyter.yap @@ -41,7 +41,6 @@ jupyter_cell( Caller, _, Line ) :- E=error(A,B), system_error(A,B) ). -jupyter_cell(_,_,_). restreams(call) :- streams(true). @@ -207,4 +206,4 @@ plot_inline :- :- endif. -:- ( start_low_level_trace ). +%:- ( start_low_level_trace ). diff --git a/pl/boot.yap b/pl/boot.yap index 94ebc41d8..390c3e10a 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -121,9 +121,11 @@ print_message(L,E) :- ). '$undefp0'([M|G], _Action) :- - stream_property( loop_stream, file_name(F)), - stream_property( loop_stream, line_number(L)), - format(user_error,'~a:~d error undefined: call to ~w~n',[F,L,M:G]), + stream_property( loop_stream, [file_name(F), line_number(L)]), + format(user_error,'~a:~d error undefined:',[F,L]), + fail + ; + format(user_error,' call to ~w~n',[M:G]), fail. :- '$undefp_handler'('$undefp0'(_,_),prolog).