summaryrefslogtreecommitdiff
path: root/js/lib/node.js
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-09 18:41:28 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-09 18:41:28 -0800
commit05c60132f4ba80f5d62d99e7d0be27715ade06e5 (patch)
tree054e7262895e13eb69293d679b6af40ee28e431f /js/lib/node.js
parent340ecdac6e34b37588a0f85e2576ff621d6818d9 (diff)
Replaced 'pos' with 'sourceloc', making it an array.
This is a more compact representation.
Diffstat (limited to 'js/lib/node.js')
-rw-r--r--js/lib/node.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/lib/node.js b/js/lib/node.js
index da33b9e..dfc77ab 100644
--- a/js/lib/node.js
+++ b/js/lib/node.js
@@ -60,14 +60,14 @@ NodeWalker.prototype.next = function(){
return {entering: entering, node: cur};
};
-function Node(nodeType, pos) {
+function Node(nodeType, sourceloc) {
this.t = nodeType;
this.parent = null;
this.firstChild = null;
this.lastChild = null;
this.prev = null;
this.next = null;
- this.pos = pos || {};
+ this.sourceloc = sourceloc;
this.last_line_blank = false;
this.open = true;
this.strings = undefined;
@@ -167,7 +167,7 @@ Node.prototype.toAST = function() {
var cur;
var result = { t: this.t };
- var propsToShow = ['t', 'c', 'list_data', 'pos', 'info', 'level'];
+ var propsToShow = ['t', 'c', 'list_data', 'sourceloc', 'info', 'level'];
for (var i = 0; i < propsToShow.length; i++) {
var prop = propsToShow[i];