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

Function clauseHeader

src/extraction/languages/erlang.ts:128–132  ·  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

126
127/** `name(Args) when Guard` — the clause text up to the `->`. */
128function clauseHeader(clause: SyntaxNode, source: string): string | undefined {
129 const body = getChildByField(clause, 'body');
130 const end = body ? body.startIndex : clause.endIndex;
131 return collapseWs(source.substring(clause.startIndex, end)) || undefined;
132}
133
134function handleFunDecl(node: SyntaxNode, ctx: ExtractorContext): boolean {
135 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