ipython
This commit is contained in:
parent
b31493c777
commit
68ce1fd045
@ -41,7 +41,7 @@ jupyter_cell(Caller, _, Line ) :-
|
||||
Query = Caller,
|
||||
catch(
|
||||
python_query(Query,Line),
|
||||
E=error(A,B),
|
||||
error(A,B),
|
||||
system_error(A,B)
|
||||
).
|
||||
|
||||
@ -69,7 +69,7 @@ jupyter_consult(Cell) :-
|
||||
open_mem_read_stream( Cell, Stream),
|
||||
load_files(user:'jupyter cell',[stream(Stream)| Options])
|
||||
),
|
||||
E=error(A,B),
|
||||
error(A,B),
|
||||
(close(Stream), system_error(A,B))
|
||||
),
|
||||
fail.
|
||||
|
@ -23,7 +23,7 @@
|
||||
jupyter( []).
|
||||
|
||||
ready( Engine, Query) :-
|
||||
errors( Engine , Cell ),
|
||||
errors( Engine , Query ),
|
||||
Es := Engine.errors,
|
||||
not Es == [].
|
||||
|
||||
@ -50,11 +50,11 @@ open_esh(Engine , Text, Stream, Name) :-
|
||||
Name := Engine.stream_name,
|
||||
open_mem_read_stream( Text, Stream ).
|
||||
|
||||
esh(Engine , Name, Stream) :-
|
||||
esh(Engine , _Name, Stream) :-
|
||||
repeat,
|
||||
catch(
|
||||
read_clause(Stream, Cl, [ syntax_errors(dec10)]),
|
||||
error(C,E),
|
||||
read_clause(Stream, Cl, [ syntax_errors(dec10)]),
|
||||
error(C,E),
|
||||
p3_message(C,Engine,E)
|
||||
),
|
||||
Cl == end_of_file,
|
||||
@ -77,19 +77,19 @@ close_esh( _Engine , Stream ) :-
|
||||
|
||||
|
||||
p3_message( _Severity, Engine, error(syntax_error(Cause),info(between(_,LN,_), _FileName, CharPos, Details))) :-
|
||||
python_clear_errors,
|
||||
!,
|
||||
Engine.errors := [t(Cause,LN,CharPos,Details)]+Engine.errors.
|
||||
p3_message(error, Engine, E) :-
|
||||
python_clear_errors,
|
||||
!,
|
||||
Engine.errors := [t(Cause,LN,CharPos,Details)]+Engine.errors .
|
||||
p3_message(error, _Engine, _E) :-
|
||||
python_clear_errors,
|
||||
!.
|
||||
p3_message(warning, Engine, E) :-
|
||||
!.
|
||||
p3_message(error, Engine, E) :-
|
||||
Engine.errors := [E] + Engine.errors.
|
||||
p3_message(warning, Engine, E) :-
|
||||
Engine.errors := [E] + Engine.errors.
|
||||
%% ready(_Self, Line ) :-
|
||||
p3_message(warning, _Engine, _E) :-
|
||||
!.
|
||||
p3_message(error, Engine, E) :-
|
||||
Engine.errors := [E] + Engine.errors.
|
||||
p3_message(warning, Engine, E) :-
|
||||
Engine.errors := [E] + Engine.errors.
|
||||
%% ready(_Self, Line ) :-
|
||||
%% blank( Line ),
|
||||
%% !.
|
||||
%% ready(Self, Line ) :-
|
||||
|
@ -684,7 +684,7 @@ class YAPRun:
|
||||
for i in self.errors:
|
||||
try:
|
||||
(_,lin,pos,text) = i
|
||||
e = SyntaxError(what, (self.cell_name, lin, pos, text+'\n'))
|
||||
e = self.SyntaxError( (self.cell_name, lin, pos, text+'\n'))
|
||||
raise e
|
||||
except SyntaxError:
|
||||
self.shell.showsyntaxerror( )
|
||||
@ -723,7 +723,7 @@ class YAPRun:
|
||||
# Give the displayhook a reference to our ExecutionResult so it
|
||||
# can fill in the output value.
|
||||
self.shell.displayhook.exec_result = self.result
|
||||
if syntaxErrors(self, text):
|
||||
if self.syntaxErrors(cell):
|
||||
self.result.result = False
|
||||
has_raised = False
|
||||
try:
|
||||
|
Reference in New Issue
Block a user