@igorivaniuk/tlb-parser
Version:
Parse TLB syntax into TypeScript objects
16 lines (15 loc) • 464 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withParents = void 0;
const visit_1 = require("./visit");
function withParents(tree) {
for (let parent of (0, visit_1.walk)(tree)) {
for (let child of (0, visit_1.iterChildNodes)(parent)) {
// We only set it here, so ignore
// @ts-ignore
child.parent = parent;
}
}
return tree;
}
exports.withParents = withParents;