checkpoint (refactoring, WIP)
This commit is contained in:
@@ -45,22 +45,11 @@
|
||||
// XXX: eventually I should refactor the compressor to use this infrastructure.
|
||||
|
||||
function TreeTransformer(before, after) {
|
||||
TreeWalker.call(this);
|
||||
this.before = before;
|
||||
this.after = after;
|
||||
this.stack = [];
|
||||
}
|
||||
|
||||
TreeTransformer.prototype = {
|
||||
push: function (node) {
|
||||
this.stack.push(node);
|
||||
},
|
||||
pop: function() {
|
||||
return this.stack.pop();
|
||||
},
|
||||
parent: function (n) {
|
||||
return this.stack[this.stack.length - 2 - (n || 0)];
|
||||
}
|
||||
};
|
||||
TreeTransformer.prototype = new TreeWalker;
|
||||
|
||||
(function(undefined){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user