MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / visit

Function visit

src/tools/ast/parser.ts:186–199  ·  view source on GitHub ↗
(n: any)

Source from the content-addressed store, hash-verified

184export function findSyntaxErrors(rootNode: any, source: string): SyntaxError[] {
185 const errors: SyntaxError[] = [];
186 const visit = (n: any) => {
187 if (n.isError || n.isMissing) {
188 errors.push({
189 line: n.startPosition.row + 1,
190 column: n.startPosition.column,
191 text: n.text?.slice(0, 60) ?? '',
192 missing: n.isMissing,
193 });
194 }
195 for (let i = 0; i < n.childCount; i++) {
196 const child = n.child(i);
197 if (child) visit(child);
198 }
199 };
200 visit(rootNode);
201 return errors;
202}

Callers 1

findSyntaxErrorsFunction · 0.70

Calls 2

childMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected