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

Function derefSameFileValue

src/extraction/languages/cobol.ts:125–135  ·  view source on GitHub ↗

* A CICS option can name its target through a data item instead of a * literal (`TRANSID(WS-TRANID)` with `05 WS-TRANID ... VALUE 'CB00'`). * Dereference it against the SAME FILE's already-extracted data items — * the DATA DIVISION precedes the PROCEDURE DIVISION, so they are in * ctx.nodes by t

(name: string, ctx: ExtractorContext)

Source from the content-addressed store, hash-verified

123 * arrays, computed names) is dynamic dispatch: skipped, not guessed.
124 */
125function derefSameFileValue(name: string, ctx: ExtractorContext): string | undefined {
126 const upper = name.toUpperCase();
127 for (const node of ctx.nodes) {
128 if (node.filePath !== ctx.filePath) continue;
129 if (node.kind !== 'variable' && node.kind !== 'field' && node.kind !== 'constant') continue;
130 if (node.name.toUpperCase() !== upper) continue;
131 const value = node.signature ? VALUE_LITERAL_RE.exec(node.signature) : null;
132 return value?.[1];
133 }
134 return undefined;
135}
136
137/**
138 * EXEC ... END-EXEC blocks are opaque single nodes. Mine the text for the

Callers 1

handleExecFunction · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected