mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 08:32:50 -06:00
gfse: when uploading/compiling a grammar, automatically upload inherited grammars as well
This commit is contained in:
@@ -49,14 +49,18 @@ function old_upload(g) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Upload the grammar to the server and check it for errors
|
// Upload the grammar to the server and check it for errors
|
||||||
function upload(g,cont) {
|
function upload_grammars(gs,cont) {
|
||||||
function upload2(dir) {
|
function upload2(dir) {
|
||||||
var pre="dir="+encodeURIComponent(dir)
|
var pre="dir="+encodeURIComponent(dir)
|
||||||
var form= {command:"make"}
|
var form= {command:"make"}
|
||||||
|
for(var aix in gs) {
|
||||||
|
var g=gs[aix]
|
||||||
form[encodeURIComponent(g.basename+".gf")]=show_abstract(g)
|
form[encodeURIComponent(g.basename+".gf")]=show_abstract(g)
|
||||||
for(var i in g.concretes) {
|
var cnc=g.concretes
|
||||||
var cname=g.basename+g.concretes[i].langcode+".gf";
|
for(var i in cnc) {
|
||||||
form[encodeURIComponent(cname)]=show_concrete(g)(g.concretes[i]);
|
var cname=g.basename+cnc[i].langcode+".gf";
|
||||||
|
form[encodeURIComponent(cname)]=show_concrete(g)(cnc[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ajax_http_post("/cloud",pre+encodeArgs(form),upload3)
|
ajax_http_post("/cloud",pre+encodeArgs(form),upload3)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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_cats(g) {return all_inherited_cats(inherited_grammars(g),{})}
|
||||||
function inherited_funs(g) {return all_inherited_funs(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]
|
// inherited_grammars :: Grammar -> [Grammar]
|
||||||
function inherited_grammars(g) {
|
function inherited_grammars(g) {
|
||||||
// Load the available grammars once
|
// Load the available grammars once
|
||||||
|
|||||||
Reference in New Issue
Block a user