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

Method walkProgram

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

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