This commit is contained in:
Vitor Santos Costa 2018-02-01 14:55:09 +00:00
parent 24d895d100
commit 5ea47853ac
3 changed files with 26 additions and 17 deletions

View File

@ -845,7 +845,7 @@ bool Yap_CVT_Text(seq_tv_t *inp, seq_tv_t *out USES_REGS) {
// cnt++;
int l = push_text_stack();
buf = Yap_readText(inp PASS_REGS);
if (!buf) {
if (!buf || buf[0] == '\0') {
pop_text_stack(l);
return 0L;
}

View File

@ -1,18 +1,27 @@
requirejs.config({
map: {
'*' : {
'codemirror/mode/prolog/prolog':'/kernelspecs/yap_kernel/prolog.js'
}
}
});
define([
"/kernelspecs/yap_kernel/prolog.js"],function(CodeMirror){
'codemirror/lib/codemirror',
'base/js/namespace',
'base/js/events',
],function(Jupyter,events,CodeMirror){
var onload = function(){
console.log("I am being loaded");
var cell = Jupyter.notebook.get_selected_cell();
var cm = cell.config;
var patch = {
CodeCell:{
cm_config:{mode: "prolog"} // only change here.
}
var mode = {
mime: "text/x-prolog",
name: "Prolog",
mode: "prolog",
ext: ["pl", "yap", "yss", "P"]
};
config.update(patch);
//console.log("I am being loaded");
CodeMirror.requireMode("prolog", mode);
CodeMirror.setOption("mode",mode);
return {onload:onload};
}
}
);
}});

View File

@ -61,7 +61,7 @@ blankc('\n').
blankc('\t').
enter_cell(_Self) :-
%open('//python/sys.stdin', read, _Input, []),
open('//python/input', read, _Input, []),
open('//python/sys.stdout', append, _Output, []),
open('//python/sys.stdout', append, _Error, []),
%set_prolog_flag(user_input, _Input),