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

Function handleCopy

src/extraction/languages/cobol.ts:104–115  ·  view source on GitHub ↗

COPY [IN/OF lib] — import node + imports reference.

(node: SyntaxNode, ctx: ExtractorContext)

Source from the content-addressed store, hash-verified

102
103/** COPY <book> [IN/OF lib] — import node + imports reference. */
104function handleCopy(node: SyntaxNode, ctx: ExtractorContext): void {
105 const book = getChildByField(node, 'book');
106 if (!book) return;
107 const name = getNodeText(book, ctx.source)
108 .trim()
109 .replace(/^['"]|['"]$/g, '');
110 if (!name) return;
111 ctx.createNode('import', name, node, {
112 signature: collapse(getNodeText(node, ctx.source)),
113 });
114 addRef(ctx, currentScope(ctx), name, 'imports', node);
115}
116
117/**
118 * A CICS option can name its target through a data item instead of a

Callers 3

walkDataEntriesFunction · 0.85
collectRefsFunction · 0.85
cobol.tsFile · 0.85

Calls 6

getChildByFieldFunction · 0.90
getNodeTextFunction · 0.90
collapseFunction · 0.85
addRefFunction · 0.85
currentScopeFunction · 0.85
createNodeMethod · 0.65

Tested by

no test coverage detected