(
outputFilename: string,
output: CompilationResult,
options?: {['clang-format']: boolean} | null,
)
| 1751 | } |
| 1752 | |
| 1753 | async processLeanCOutput( |
| 1754 | outputFilename: string, |
| 1755 | output: CompilationResult, |
| 1756 | options?: {['clang-format']: boolean} | null, |
| 1757 | ): Promise<ResultLine[]> { |
| 1758 | if (output.code !== 0) { |
| 1759 | return [{text: 'Failed to run compiler to get Lean C output'}]; |
| 1760 | } |
| 1761 | const outpath = this.getLeanCOutputFilename(outputFilename); |
| 1762 | if (await utils.fileExists(outpath)) { |
| 1763 | let content = await fs.readFile(outpath, 'utf8'); |
| 1764 | if (options?.['clang-format']) { |
| 1765 | content = await this.applyClangFormat(content); |
| 1766 | } |
| 1767 | return content.split('\n').map(line => ({text: line})); |
| 1768 | } |
| 1769 | return [{text: 'Internal error; unable to open output path'}]; |
| 1770 | } |
| 1771 | |
| 1772 | async processYulOutput( |
| 1773 | defaultOutputFilename: string, |
no test coverage detected