Legacy tag-based CFML: walk ` `/` `, delegating ` ` bodies.
()
| 92 | |
| 93 | /** Legacy tag-based CFML: walk `<cfcomponent>`/`<cffunction>`, delegating `<cfscript>` bodies. */ |
| 94 | private extractTagBased(): void { |
| 95 | const parser = getParser('cfml'); |
| 96 | if (!parser) { |
| 97 | this.errors.push({ |
| 98 | message: 'cfml grammar not loaded', |
| 99 | severity: 'error', |
| 100 | code: 'unsupported_language', |
| 101 | }); |
| 102 | return; |
| 103 | } |
| 104 | |
| 105 | const tree = parser.parse(this.source); |
| 106 | if (!tree) { |
| 107 | this.errors.push({ |
| 108 | message: 'Failed to parse CFML source', |
| 109 | severity: 'error', |
| 110 | code: 'parse_error', |
| 111 | }); |
| 112 | return; |
| 113 | } |
| 114 | |
| 115 | const fileNode = this.createFileNode(); |
| 116 | this.walkProgram(tree.rootNode, fileNode.id); |
| 117 | } |
| 118 | |
| 119 | /** Build the file's own `kind:'file'` node, spanning the whole source. Tag-based files need this explicitly — unlike `extractBareScript` (which delegates the whole file to `TreeSitterExtractor` and inherits its file node), `extractTagBased` walks the tree itself and has no other source of one. */ |
| 120 | private createFileNode(): Node { |
no test coverage detected