(parserIdsInScope)
| 19556 | return getters.join("\n") |
| 19557 | } |
| 19558 | _createParserInfo(parserIdsInScope) { |
| 19559 | const result = { |
| 19560 | cueMap: {}, |
| 19561 | regexTests: [] |
| 19562 | } |
| 19563 | if (!parserIdsInScope.length) return result |
| 19564 | const allProgramParserDefinitionsMap = this.programParserDefinitionCache |
| 19565 | Object.keys(allProgramParserDefinitionsMap) |
| 19566 | .filter(parserId => { |
| 19567 | const def = allProgramParserDefinitionsMap[parserId] |
| 19568 | return def.isOrExtendsAParserInScope(parserIdsInScope) && !def._isAbstract() |
| 19569 | }) |
| 19570 | .forEach(parserId => { |
| 19571 | const def = allProgramParserDefinitionsMap[parserId] |
| 19572 | const regex = def.regexMatch |
| 19573 | const cue = def.cueIfAny |
| 19574 | const enumOptions = def.cueEnumOptions |
| 19575 | if (regex) result.regexTests.push({ regex: regex, parser: def.parserIdFromDefinition }) |
| 19576 | else if (cue) result.cueMap[cue] = def |
| 19577 | else if (enumOptions) { |
| 19578 | enumOptions.forEach(option => (result.cueMap[option] = def)) |
| 19579 | } |
| 19580 | }) |
| 19581 | return result |
| 19582 | } |
| 19583 | get topParserDefinitions() { |
| 19584 | const arr = Object.values(this.cueMapWithDefinitions) |
| 19585 | arr.sort(Utils.makeSortByFn(definition => definition.popularity)) |
no test coverage detected