From 05c60132f4ba80f5d62d99e7d0be27715ade06e5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 9 Jan 2015 18:41:28 -0800 Subject: Replaced 'pos' with 'sourceloc', making it an array. This is a more compact representation. --- js/lib/node.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/lib/node.js') 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]; -- cgit v1.2.3