From 13399da7f5eea223db86ff4d30403bc714c5816c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Tue, 14 Jul 2015 17:57:06 +0200 Subject: Implemented a parser of simple pythonic definitions. --- js/codeq.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/codeq.js') diff --git a/js/codeq.js b/js/codeq.js index 3a30823..770153e 100644 --- a/js/codeq.js +++ b/js/codeq.js @@ -614,7 +614,7 @@ window.siteDefinition = { logLevel: 'debug' }; // for debug purposes // -------------------------------------------------------------------------------- // Task info parser: converts simplified pythonic syntax to a JavaScript function // -------------------------------------------------------------------------------- - + // deprecated: use codeq.parseDefinition() instead parseInfo: function (infoText) { var parts = [], n, lines, line, i, j, len, walker, fn, obj; @@ -700,7 +700,7 @@ window.siteDefinition = { logLevel: 'debug' }; // for debug purposes // if (s.length == 0) return; // empty hash // if (s.charAt(0) == '#') s = s.substring(1); // if (s.length == 0) return; // empty hash - var editor = CodeMirror.fromTextArea(document.getElementById('program'), { cursorHeight: 0.85, lineNumbers: true, matchBrackets: true }); + var editor = CodeMirror(document.getElementById('code_editor'), { cursorHeight: 0.85, lineNumbers: true, matchBrackets: true }); editor.setValue('sister(X, Y) :-\n female(X),\n parent(Z, X),\n parent(Z, Y),\n X \\== Y.'); /* $('#console').terminal(function (command, term) { @@ -734,7 +734,7 @@ window.siteDefinition = { logLevel: 'debug' }; // for debug purposes url: 'sister.py', callback: function (data, status, url) { if (!data) return; - var info = codeq.system.parseInfo(data); + var info = codeq.parseDefinition(data); $('#description').html(info.description); } }); -- cgit v1.2.1