MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / createEmitter

Function createEmitter

packages/alphatab/scripts/EmitterBase.ts:84–101  ·  view source on GitHub ↗
(
    jsDocMarker: string,
    generate: (program: ts.Program, classDeclaration: ts.ClassDeclaration) => ts.SourceFile
)

Source from the content-addressed store, hash-verified

82}
83
84export default function createEmitter(
85 jsDocMarker: string,
86 generate: (program: ts.Program, classDeclaration: ts.ClassDeclaration) => ts.SourceFile
87) {
88 function scanSourceFile(program: ts.Program, sourceFile: ts.SourceFile) {
89 for (const stmt of sourceFile.statements) {
90 if (ts.isClassDeclaration(stmt) && ts.getJSDocTags(stmt).some(t => t.tagName.text === jsDocMarker)) {
91 generateClass(program, stmt, generate);
92 }
93 }
94 }
95
96 return function emit(program: ts.Program, _diagnostics: ts.Diagnostic[]) {
97 for (const file of program.getRootFileNames()) {
98 scanSourceFile(program, program.getSourceFile(file)!);
99 }
100 };
101}

Callers 3

CloneEmitter.tsFile · 0.85

Calls 1

scanSourceFileFunction · 0.85

Tested by

no test coverage detected