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

Function clauseHeader

src/extraction/languages/erlang.ts:93–97  ·  view source on GitHub ↗

`name(Args) when Guard` — the clause text up to the `->`.

(clause: SyntaxNode, source: string)

Source from the content-addressed store, hash-verified

91
92/** `name(Args) when Guard` — the clause text up to the `->`. */
93function clauseHeader(clause: SyntaxNode, source: string): string | undefined {
94 const body = getChildByField(clause, 'body');
95 const end = body ? body.startIndex : clause.endIndex;
96 return collapseWs(source.substring(clause.startIndex, end)) || undefined;
97}
98
99function handleFunDecl(node: SyntaxNode, ctx: ExtractorContext): boolean {
100 const clauses = node.namedChildren.filter((c) => c.type === 'function_clause');

Callers 1

handleFunDeclFunction · 0.85

Calls 2

getChildByFieldFunction · 0.90
collapseWsFunction · 0.85

Tested by

no test coverage detected