diff options
| author | john.j.camilleri <john.j.camilleri@chalmers.se> | 2012-11-27 10:09:40 +0000 |
|---|---|---|
| committer | john.j.camilleri <john.j.camilleri@chalmers.se> | 2012-11-27 10:09:40 +0000 |
| commit | b3c1177f9ed5a3eaff378671fa119be1c605498e (patch) | |
| tree | 6c32e5fc86fd45b91a934b8d0fc6da2cf236ab8a /src/www/syntax-editor/ast.js | |
| parent | def375e58808ea431ef0d786ae0abb9de0a67155 (diff) | |
Syntax editor: improvements and fixes with grammar manager
Diffstat (limited to 'src/www/syntax-editor/ast.js')
| -rw-r--r-- | src/www/syntax-editor/ast.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/www/syntax-editor/ast.js b/src/www/syntax-editor/ast.js index 143b9836c..2cad53600 100644 --- a/src/www/syntax-editor/ast.js +++ b/src/www/syntax-editor/ast.js @@ -8,7 +8,7 @@ function NodeID(x) { switch (typeof x) { case "number": this.id = [x]; break; case "string": this.id = map(function(s){return parseInt(s)}, x.split(",")); break; - case "object": this.id = x.get().slice(); break; // another NodeID + case "object": this.id = Array.clone(x.get()); break; // another NodeID } } @@ -101,7 +101,7 @@ function AST(fun, cat) { // set tree at given id this._setSubtree = function(id, subtree) { - var lid = id.get().slice(); // clone NodeID array + var lid = Array.clone(id.get()); // clone NodeID array var node = this.root; if (lid.length==1) @@ -124,7 +124,7 @@ function AST(fun, cat) { switch (typeof id) { case "number": lid = [id]; break; case "string": lid = id.split(","); break; - case "object": lid = id.get().slice(); break; // clone NodeID array + case "object": lid = Array.clone(id.get()); break; // clone NodeID array } var node = this.root; if (lid[0] == 0) lid.shift(); |
