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

Function findSyntaxErrors

src/tools/ast/parser.ts:184–202  ·  view source on GitHub ↗
(rootNode: any, source: string)

Source from the content-addressed store, hash-verified

182}
183
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

executeMethod · 0.85

Calls 1

visitFunction · 0.70

Tested by

no test coverage detected