@jqassistant/ts-lce
Version:
Tool to extract language concepts from a TypeScript codebase and export them to a JSON file.
23 lines (22 loc) • 841 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecutionCondition = void 0;
/**
* Represents the condition under which a `Processor` is executed.
*/
class ExecutionCondition {
currentNodeType;
check;
/** Condition that never returns true */
static NEVER = new ExecutionCondition([], () => false);
/**
* Creates new ExecutionCondition
* @param currentNodeType 1. Check: types of the current node on which the condition shall be checked
* @param check 2. Check: function to perform advanced checks on the global and local contexts, and on the node involving parent/sibling nodes, etc.
*/
constructor(currentNodeType, check) {
this.currentNodeType = currentNodeType;
this.check = check;
}
}
exports.ExecutionCondition = ExecutionCondition;