intial
This commit is contained in:
36
node_modules/svelte-eslint-parser/lib/context/let-directive-collection.js
generated
vendored
Normal file
36
node_modules/svelte-eslint-parser/lib/context/let-directive-collection.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/** A class that collects pattern nodes for Let directives. */
|
||||
export 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;
|
||||
}
|
||||
}
|
||||
export class LetDirectiveCollections {
|
||||
constructor() {
|
||||
this.stack = [];
|
||||
}
|
||||
beginExtract() {
|
||||
this.stack.push(new LetDirectiveCollection());
|
||||
}
|
||||
getCollection() {
|
||||
return this.stack[this.stack.length - 1];
|
||||
}
|
||||
extract() {
|
||||
return this.stack.pop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user