summaryrefslogtreecommitdiff
path: root/js/lib/node.js
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-11 20:28:05 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-11 20:28:05 -0800
commita17a86cbcfb2a4775638c00bca83e54d4ee5f30f (patch)
treeee2acf0baa044643ba0d4a3d22aa72fcf2914b76 /js/lib/node.js
parentd307c3eb1b9ff81d929755ac293ad50ef49c6a74 (diff)
node.js: toAST -> toObject.
Diffstat (limited to 'js/lib/node.js')
-rw-r--r--js/lib/node.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/lib/node.js b/js/lib/node.js
index c8b31f0..381b379 100644
--- a/js/lib/node.js
+++ b/js/lib/node.js
@@ -164,7 +164,7 @@ Node.prototype.walker = function() {
return walker;
};
-var toASTNode = function(node) {
+var nodeToObject = function(node) {
var result = {};
var propsToShow = ['t', 'literal', 'list_data', 'sourcepos',
'info', 'level', 'title', 'destination'];
@@ -178,7 +178,7 @@ var toASTNode = function(node) {
return result;
};
-Node.prototype.toAST = function() {
+Node.prototype.toObject = function() {
var childrenStack = [];
var walker = this.walker();
var event;
@@ -192,14 +192,14 @@ Node.prototype.toAST = function() {
if (entering) {
childrenStack.push([]);
} else {
- astnode = toASTNode(node);
+ astnode = nodeToObject(node);
astnode.children = childrenStack.pop();
if (childrenStack.length > 0) {
childrenStack[childrenStack.length - 1].push(astnode);
}
}
} else {
- astnode = toASTNode(node);
+ astnode = nodeToObject(node);
childrenStack[childrenStack.length - 1].push(astnode);
}
}