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

Method extractTagBased

src/extraction/cfml-extractor.ts:147–176  ·  view source on GitHub ↗

Legacy tag-based CFML: walk ` `/` `, delegating ` ` bodies.

()

Source from the content-addressed store, hash-verified

145
146 /** Legacy tag-based CFML: walk `<cfcomponent>`/`<cffunction>`, delegating `<cfscript>` bodies. */
147 private extractTagBased(): void {
148 const parser = getParser('cfml');
149 if (!parser) {
150 this.errors.push({
151 message: 'cfml grammar not loaded',
152 severity: 'error',
153 code: 'unsupported_language',
154 });
155 return;
156 }
157
158 const tree = parser.parse(this.source);
159 if (!tree) {
160 this.errors.push({
161 message: 'Failed to parse CFML source',
162 severity: 'error',
163 code: 'parse_error',
164 });
165 return;
166 }
167
168 try {
169 const fileNode = this.createFileNode();
170 this.walkProgram(tree.rootNode, fileNode.id);
171 } finally {
172 // Trees hold wasm heap memory V8's GC never sees — free it per file.
173 tree.delete();
174 }
175 this.extractTagExpressions();
176 }
177
178 /** 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. */
179 private createFileNode(): Node {

Callers 1

extractMethod · 0.95

Calls 7

createFileNodeMethod · 0.95
walkProgramMethod · 0.95
extractTagExpressionsMethod · 0.95
getParserFunction · 0.90
pushMethod · 0.80
parseMethod · 0.80
deleteMethod · 0.65

Tested by

no test coverage detected