File size: 1,141 Bytes
bc20498 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LetDirectiveCollections = exports.LetDirectiveCollection = void 0;
/** A class that collects pattern nodes for Let directives. */
class LetDirectiveCollection {
constructor() {
this.list = [];
}
getLetParams() {
return this.list;
}
addPattern(pattern, directive, typing, ...callbacks) {
this.list.push({
node: pattern,
parent: directive,
typing,
callback(node, options) {
for (const callback of callbacks) {
callback(node, options);
}
},
});
return callbacks;
}
}
exports.LetDirectiveCollection = LetDirectiveCollection;
class LetDirectiveCollections {
constructor() {
this.stack = [];
}
beginExtract() {
this.stack.push(new LetDirectiveCollection());
}
getCollection() {
return this.stack[this.stack.length - 1];
}
extract() {
return this.stack.pop();
}
}
exports.LetDirectiveCollections = LetDirectiveCollections;
|