diff --git a/src/editor/simple/TODO b/src/editor/simple/TODO index 1d876e9d9..be97bc47a 100644 --- a/src/editor/simple/TODO +++ b/src/editor/simple/TODO @@ -9,7 +9,7 @@ - Allow languages other than the ones in the given list to be added + Export as plain text -- Allow definitions to be reordered ++ Allow definitions to be reordered + 1. possibility to compile the grammar set, returning a URL to a translator app - 2. possibility to import modules - both resource libraries and user's own @@ -18,7 +18,7 @@ + 4. access to the created files in an on-line shell (making testing possible) - 5. rule-to-rule type checking and guidance (e.g. with library oper suggestions) -- Try grammars in the Translation Quiz ++ Try grammars in the Translation Quiz + compile only the uploaded grammar even if other grammars are present + 'flags startcat' is needed for grammars with only one category (since the diff --git a/src/editor/simple/editor.js b/src/editor/simple/editor.js index 6420b5eac..f829c12f8 100644 --- a/src/editor/simple/editor.js +++ b/src/editor/simple/editor.js @@ -248,13 +248,17 @@ function draw_abstract(g) { var flags=g.abstract.startcat || g.abstract.cats.length>1 ? draw_startcat(g) : text(""); + function sort_funs() { + g.abstract.funs=sort_list(this,g.abstract.funs,"name"); + save_grammar(g); + } return div_id("file", [kw("abstract "),ident(g.basename),sep(" = "), flags, indent([extensible([kw_cat, indent(draw_cats(g))]), extensible([kw_fun, - indent(draw_funs(g))])])]); + indent_sortable(draw_funs(g),sort_funs)])])]); } function add_cat(g,el) { @@ -371,7 +375,7 @@ function draw_funs(g) { } // for(var i=0;i +