From b58fc79908efb52320a38fdf6df96d8d0d067e73 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 29 Jul 2011 15:44:19 +0000 Subject: gfse: some correctness checks for concrete syntax The editor now calls the GF server to check the syntax of expressions that are part of concrete syntax (except for parameter types). This is currently done by using the cc command of the GF shell, which puts some unnecessary restricitons on operation definitions... --- src/editor/simple/cloud.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/editor/simple/cloud.js') diff --git a/src/editor/simple/cloud.js b/src/editor/simple/cloud.js index cd2b9a442..fad66e1ff 100644 --- a/src/editor/simple/cloud.js +++ b/src/editor/simple/cloud.js @@ -136,6 +136,11 @@ function gfshell(cmd,cont) { // Check the syntax of an expression function check_exp(s,cont) { - // Not implemented yet!! - cont(null) + function check(gf_message) { + debug("cc "+s+" = "+gf_message); + cont(/parse error/.test(gf_message) ? "parse error" : null); + } + if(navigator.onLine) + ajax_http_get("upload.cgi?cc="+encodeURIComponent(s),check) + else cont(null) } -- cgit v1.2.3