MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / formatMessage

Method formatMessage

lib/TreeSitter/web-tree-sitter.js:3376–3389  ·  view source on GitHub ↗

Formats an error message based on the error kind and info

(kind, info2)

Source from the content-addressed store, hash-verified

3374 }
3375 /** Formats an error message based on the error kind and info */
3376 static formatMessage(kind, info2) {
3377 switch (kind) {
3378 case QueryErrorKind.NodeName:
3379 return `Bad node name '${info2.word}'`;
3380 case QueryErrorKind.FieldName:
3381 return `Bad field name '${info2.word}'`;
3382 case QueryErrorKind.CaptureName:
3383 return `Bad capture name @${info2.word}`;
3384 case QueryErrorKind.PatternStructure:
3385 return `Bad pattern structure at offset ${info2.suffix}`;
3386 case QueryErrorKind.Syntax:
3387 return `Bad syntax at offset ${info2.suffix}`;
3388 }
3389 }
3390};
3391function parseAnyPredicate(steps, index, operator, textPredicates) {
3392 if (steps.length !== 3) {

Callers 1

constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected