* 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)
| 123 | * arrays, computed names) is dynamic dispatch: skipped, not guessed. |
| 124 | */ |
| 125 | function 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 |