gfse: when uploading/compiling a grammar, automatically upload inherited grammars as well

This commit is contained in:
hallgren
2012-02-17 16:07:28 +00:00
parent b6104d4a29
commit 3d9760d90d
2 changed files with 15 additions and 5 deletions

View File

@@ -49,14 +49,18 @@ function old_upload(g) {
}
// Upload the grammar to the server and check it for errors
function upload(g,cont) {
function upload_grammars(gs,cont) {
function upload2(dir) {
var pre="dir="+encodeURIComponent(dir)
var form= {command:"make"}
form[encodeURIComponent(g.basename+".gf")]=show_abstract(g)
for(var i in g.concretes) {
var cname=g.basename+g.concretes[i].langcode+".gf";
form[encodeURIComponent(cname)]=show_concrete(g)(g.concretes[i]);
for(var aix in gs) {
var g=gs[aix]
form[encodeURIComponent(g.basename+".gf")]=show_abstract(g)
var cnc=g.concretes
for(var i in cnc) {
var cname=g.basename+cnc[i].langcode+".gf";
form[encodeURIComponent(cname)]=show_concrete(g)(cnc[i]);
}
}
ajax_http_post("/cloud",pre+encodeArgs(form),upload3)
}

View File

@@ -1015,6 +1015,12 @@ function defined_funs(g) { return all_defined_funs(g,inherited_gramamrs(g)) }
function inherited_cats(g) {return all_inherited_cats(inherited_grammars(g),{})}
function inherited_funs(g) {return all_inherited_funs(inherited_grammars(g),{})}
function upload(g,cont) {
var gs=inherited_grammars(g);
gs.push(g);
upload_grammars(gs,cont);
}
// inherited_grammars :: Grammar -> [Grammar]
function inherited_grammars(g) {
// Load the available grammars once