diff options
| author | john.j.camilleri <john.j.camilleri@chalmers.se> | 2012-12-07 12:55:17 +0000 |
|---|---|---|
| committer | john.j.camilleri <john.j.camilleri@chalmers.se> | 2012-12-07 12:55:17 +0000 |
| commit | 904e8029fea4436290fc79d5fabc782386cee19b (patch) | |
| tree | 6c5a6f0275acabd5ef72bb20798960c991dbaf37 /src/www/syntax-editor/ast.js | |
| parent | 81f843ac062541a7f3bec9fde23be560343b66b7 (diff) | |
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
Diffstat (limited to 'src/www/syntax-editor/ast.js')
| -rw-r--r-- | src/www/syntax-editor/ast.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/www/syntax-editor/ast.js b/src/www/syntax-editor/ast.js index 89bdcf5c4..026452697 100644 --- a/src/www/syntax-editor/ast.js +++ b/src/www/syntax-editor/ast.js @@ -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: [], |
