|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var objects = require("../utils/objects"),
|
|
|
|
|
arrays = require("../utils/arrays");
|
|
|
|
|
var objects = require("../utils/objects");
|
|
|
|
|
|
|
|
|
|
/* Simple AST node visitor builder. */
|
|
|
|
|
var visitor = {
|
|
|
|
@ -22,7 +21,7 @@ var visitor = {
|
|
|
|
|
return function(node) {
|
|
|
|
|
var extraArgs = Array.prototype.slice.call(arguments, 1);
|
|
|
|
|
|
|
|
|
|
arrays.each(node[property], function(child) {
|
|
|
|
|
node[property].forEach(function(child) {
|
|
|
|
|
visit.apply(null, [child].concat(extraArgs));
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
@ -36,7 +35,7 @@ var visitor = {
|
|
|
|
|
visit.apply(null, [node.initializer].concat(extraArgs));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
arrays.each(node.rules, function(rule) {
|
|
|
|
|
node.rules.forEach(function(rule) {
|
|
|
|
|
visit.apply(null, [rule].concat(extraArgs));
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|