* Whether the line right above `lineStart` leaves a declaration open: its * code ends in a type's last token (`unsigned long`, `char *`, `size_t * JEMALLOC_NOTHROW`). A blank line, a directive, or a comment closes none.
(source: string, lineStart: number)
| 1404 | * JEMALLOC_NOTHROW`). A blank line, a directive, or a comment closes none. |
| 1405 | */ |
| 1406 | function opensCDeclaration(source: string, lineStart: number): boolean { |
| 1407 | if (lineStart === 0) return false; |
| 1408 | const from = source.lastIndexOf('\n', lineStart - 2) + 1; |
| 1409 | const line = source.slice(from, lineStart - 1).replace(/\/\/.*$/, '').trim(); |
| 1410 | return line !== '' && !line.startsWith('#') && /[\w*]$/.test(line); |
| 1411 | } |
| 1412 | |
| 1413 | /** |
| 1414 | * Blank a macro that is the ONLY token on its line — no parens, no semicolon: |
no outgoing calls
no test coverage detected