This commit is contained in:
Vitor Santos Costa
2018-06-03 12:07:38 +01:00
parent 72a703393f
commit 1201357017
9 changed files with 725 additions and 32 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,20 +1,19 @@
/**
/*!
* @file complete.yap
*
* @brief Prolog completer.
*/
:- module( completer,
[
completions/2.
]).
[completions/2 ]).
:- use_module(library(lists)).
:- use_module(library(maplist)).
:- use_module(library(python)).
%% completions( +Text, +PythonCell )
%
%
% Tries to complete the current text. The list with the set of completions
% is stored in the
% `matches` field of the python object.
@@ -116,8 +115,3 @@ cont(0, F, P, P0) :-
atom_concat( F, P, P0 ).
cont( _, F, P, PB ):-
atom_concat( [F, P, '( )'], PB ).

View File

@@ -4,7 +4,7 @@
* @brief JUpyter support.
*/
% :- module( jupyter,
% [jupyter_query/3,
% errors/2,
@@ -52,11 +52,13 @@ jupyter_consult(Text) :-
blank( Text ),
!.
jupyter_consult(Cell) :-
open_mem_read_stream( Cell, Stream),
% Name = 'Inp',
% stream_property(Stream, file_name(Name) ),
load_files(user:'jupyter cell',[stream(Stream)]), !.
%should load_files close?
setup_call_cleanup(
open_mem_read_stream( Cell, Stream),
load_files(user:'jupyter cell',[stream(Stream)]),
close(Stream)
).
blank(Text) :-
atom_codes(Text, L),

View File

@@ -804,5 +804,4 @@ class YAPRun:
if query[-1] == '.':
return s,'',False,0
(query, _,loop, sols) = self.clean_end(query)
print(program, query, loop, sols)
return (program, query, loop, sols)