This commit is contained in:
Vitor Santos Costa
2018-01-27 10:17:27 +00:00
parent 63e8e89dab
commit f3f524960c
23 changed files with 423 additions and 376 deletions

View File

@@ -27,10 +27,11 @@
:- python_import(sys).
user:jupyter_query(Self, Cell, Line ) :-
start_low_level_trace,
setup_call_cleanup(
enter_cell(Self),
jupyter_cell(Self, Cell, Line),
exit_cell(Self)
jupyter: enter_cell(Self),
jupyter:jupyter_cell(Self, Cell, Line),
jupyter:exit_cell(Self)
).
jupyter_cell(_Self, Cell, _) :-
@@ -39,7 +40,7 @@ jupyter_cell(_Self, Cell, _) :-
jupyter_cell( _Self, _, Line ) :-
blank( Line ),
!.
jupyter_cell( Self, _, [] ) :- !.
jupyter_cell( _Self, _, [] ) :- !.
jupyter_cell( Self, _, Line ) :-
python_query( Self, Line ).
@@ -177,7 +178,7 @@ ready(_Self, Line ) :-
!.
ready(Self, Line ) :-
errors( Self, Line ),
\+ syntax_error(_,_).
\+ syntax_error(_,_).
user:errors( Self, Text ) :-
setup_call_cleanup(
@@ -245,7 +246,7 @@ open_events(Self, Text, Stream) :-
assert( syntax_error(Cause,LN,CharPos,Details) )
)).
close_events( Self ) :-
close_events( _Self ) :-
retract( undo(G) ),
call(G),
fail.

View File

@@ -61,7 +61,7 @@ class YAPInputSplitter(InputSplitter):
def __init__(self, line_input_checker=True, physical_line_transforms=None,
logical_line_transforms=None):
self._buffer_raw = []
self._validate = True
v self._validate = True
self.yapeng = None
if physical_line_transforms is not None:
@@ -524,7 +524,7 @@ class YAPRun:
return self.errors
def jupyter_query(self, s):
# import pdb; pdb.set_trace()
import pdb; pdb.set_trace()
#
# construct a self.query from a one-line string
# self.q is opaque to Python
@@ -550,8 +550,8 @@ class YAPRun:
# atom match either symbols, or if no symbol exists, sttrings, In this case
# variable names should match strings
#for eq in vs:
# if not isinstance(eq[0],str):
# print( "Error: Variable Name matches a Python Symbol")
# if not isinstance(eq[0],str):x
xf # print( "Error: Variable Name matches a Python Symbol")
# return
# ask = True
# launch the query