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

Function opensCDeclaration

src/extraction/languages/c-cpp.ts:1407–1412  ·  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

1405 * JEMALLOC_NOTHROW`). A blank line, a directive, or a comment closes none.
1406 */
1407function opensCDeclaration(source: string, lineStart: number): boolean {
1408 if (lineStart === 0) return false;
1409 const from = source.lastIndexOf('\n', lineStart - 2) + 1;
1410 const line = source.slice(from, lineStart - 1).replace(/\/\/.*$/, '').trim();
1411 return line !== '' && !line.startsWith('#') && /[\w*]$/.test(line);
1412}
1413
1414/**
1415 * 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