COPY [IN/OF lib] — import node + imports reference.
(node: SyntaxNode, ctx: ExtractorContext)
| 102 | |
| 103 | /** COPY <book> [IN/OF lib] — import node + imports reference. */ |
| 104 | function 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 |
no test coverage detected