MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / opensCDeclaration

Function opensCDeclaration

src/extraction/languages/c-cpp.ts:1406–1411  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

1404 * JEMALLOC_NOTHROW`). A blank line, a directive, or a comment closes none.
1405 */
1406function 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:

Callers 1

isCReturnTypeMacroFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected