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

Method walkProgram

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

* Walks `program`'s named children with a single forward cursor (not an * index loop) — `extractComponent` consumes a variable run of FOLLOWING * siblings as the component body (see its doc comment), so this must * resume from whatever it last consumed rather than revisiting those same *

(root: SyntaxNode, fileNodeId: string)

Source from the content-addressed store, hash-verified

206 * cffunction/cfscript siblings a second time as bogus top-level symbols.
207 */
208 private walkProgram(root: SyntaxNode, fileNodeId: string): void {
209 let child: SyntaxNode | null = root.namedChild(0);
210 while (child) {
211 if (child.type === 'cf_component_open_tag') {
212 child = this.extractComponent(child, fileNodeId).nextSibling;
213 continue;
214 }
215 // Template scope: a cffunction outside any cfcomponent wrapper (rare,
216 // but legal in a .cfm template) is a top-level function contained by
217 // the file, and template code's calls are the file's.
218 this.visitTag(child, root.type, fileNodeId, undefined, true);
219 child = child.nextSibling;
220 }
221 }
222
223 /**
224 * `<cfcomponent extends="Base" implements="IFoo,IBar">...</cfcomponent>`.

Callers 1

extractTagBasedMethod · 0.95

Calls 2

extractComponentMethod · 0.95
visitTagMethod · 0.95

Tested by

no test coverage detected