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

Function loneIdentText

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

getNodeTextFunction · 0.90

Tested by

no test coverage detected