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

This commit is contained in:
Vitor Santos Costa 2018-02-10 14:13:21 +00:00
commit e7af316ad1
4 changed files with 20 additions and 18 deletions

View File

@ -17,7 +17,9 @@ requirements:
- pkgconfig - pkgconfig
- make - make
- libxml2 - libxml2
- backcall
run: run:
- backcall
- jupyterlab - jupyterlab
- python - python
- readline - readline
@ -32,4 +34,5 @@ about:
summary: Prolog System summary: Prolog System
source: source:
path: .. git_url: ..
git_rev: master

@ -1 +0,0 @@
Subproject commit d955aca38b7aadce76e6815eb09487a370206742

View File

@ -20,7 +20,7 @@
:- use_module( library(rbtrees) ). :- use_module( library(rbtrees) ).
:- use_module( library(terms) ). :- use_module( library(terms) ).
:- reexport( library(python) ). :- reexport( library(python) ).
w
:- python_import(yap4py.yapi). :- python_import(yap4py.yapi).
%:- start_low_level_trace. %:- start_low_level_trace.

View File

@ -10,13 +10,14 @@
* - * -
*/ */
:- module( jupyter, %% :- module( jupyter,
[jupyter_query/3, %% [jupyter_query/3,
errors/2, %% errors/2,
ready/2, %% ready/2,
completion/2 %% completion/2,
]
). %% ]
%% ).
:- reexport(library(yapi)). :- reexport(library(yapi)).
@ -26,12 +27,11 @@
:- python_import(sys). :- python_import(sys).
user:jupyter_query(Self, Cell, Line ) :- jupyter_query(Self, Cell, Line ) :-
start_low_level_trace,
setup_call_cleanup( setup_call_cleanup(
jupyter: enter_cell(Self), enter_cell(Self),
jupyter:jupyter_cell(Self, Cell, Line), jupyter_cell(Self, Cell, Line),
jupyter:exit_cell(Self) exit_cell(Self)
). ).
jupyter_cell(_Self, Cell, _) :- jupyter_cell(_Self, Cell, _) :-
@ -61,7 +61,7 @@ blankc('\n').
blankc('\t'). blankc('\t').
enter_cell(_Self) :- enter_cell(_Self) :-
open('//python/input', read, _Input, []), %open('//python/input', read, _Input, []),
open('//python/sys.stdout', append, _Output, []), open('//python/sys.stdout', append, _Output, []),
open('//python/sys.stdout', append, _Error, []), open('//python/sys.stdout', append, _Error, []),
%set_prolog_flag(user_input, _Input), %set_prolog_flag(user_input, _Input),
@ -74,7 +74,7 @@ exit_cell(_Self) :-
close( user_error). close( user_error).
user:completions(S, Self) :- completions(S, Self) :-
open_mem_read_stream(S, St), open_mem_read_stream(S, St),
scan_to_list(St, Tokens), scan_to_list(St, Tokens),
close(St), close(St),
@ -180,7 +180,7 @@ ready(Self, Line ) :-
errors( Self, Line ), errors( Self, Line ),
\+ syntax_error(_,_). \+ syntax_error(_,_).
user:errors( Self, Text ) :- errors( Self, Text ) :-
setup_call_cleanup( setup_call_cleanup(
open_events( Self, Text, Stream), open_events( Self, Text, Stream),
clauses(Self, Stream), clauses(Self, Stream),