()
| 38 | } |
| 39 | |
| 40 | parse() { |
| 41 | // Run pre-emit diagnostics. |
| 42 | if (!this.project.skipPreEmitDiagnostics) |
| 43 | this.runPreEmitDiagnostics(); |
| 44 | // Start parsing. |
| 45 | for (const fileName of this.program.getRootFileNames()) { |
| 46 | const sourceFile = this.program.getSourceFile(fileName)!; |
| 47 | const cppFile = this.parseSourceFile(fileName, sourceFile); |
| 48 | this.project.addParsedFile(cppFile.name, cppFile); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | runPreEmitDiagnostics() { |
| 53 | const diagnostics = ts.getPreEmitDiagnostics(this.program); |