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

Method walkProgram

src/extraction/cfml-extractor.ts:212–225  ·  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

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