mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-06 17:52:51 -06:00
Syntax editor: various small improvements...
- separate tree edit buttons from option buttons - fix bug when wrapping on freshly imported ast - add interface for import & export of ast - cleaner internal implementation of Editor.add_refinement - small style updates
This commit is contained in:
@@ -183,9 +183,11 @@ function AST(fun, cat) {
|
||||
var lid = Array.clone(id.get()); // clone NodeID array
|
||||
var node = this.root;
|
||||
|
||||
if (lid.length==1)
|
||||
if (lid.length==1) {
|
||||
// Insert at root
|
||||
this.root = new ASTNode(subtree);
|
||||
this.currentNode = this.root;
|
||||
}
|
||||
else {
|
||||
lid.shift(); // throw away root
|
||||
while (lid.length>1 && node.hasChildren()) {
|
||||
@@ -297,6 +299,7 @@ function AST(fun, cat) {
|
||||
// (This probably needs a better home)
|
||||
AST.parse_type_signature = function(str) {
|
||||
var obj = {
|
||||
signature: str,
|
||||
type: undefined,
|
||||
name: [],
|
||||
deps: [],
|
||||
|
||||
Reference in New Issue
Block a user