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

Function loneIdentText

src/extraction/languages/c-cpp.ts:338–343  ·  view source on GitHub ↗
(p: SyntaxNode)

Source from the content-addressed store, hash-verified

336 const params = getChildByField(declarator, 'parameters');
337 if (!params || params.namedChildCount < 2) return undefined;
338 const loneIdentText = (p: SyntaxNode): string | null =>
339 p.type === 'parameter_declaration' &&
340 p.namedChildCount === 1 &&
341 p.namedChild(0)?.type === 'type_identifier'
342 ? getNodeText(p.namedChild(0)!, source)
343 : null;
344 const first = params.namedChild(0);
345 const name = first ? loneIdentText(first) : null;
346 if (!name || !/[a-z]/.test(name)) return undefined;

Callers 1

Calls 1

getNodeTextFunction · 0.90

Tested by

no test coverage detected