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

Function skipQuoted

src/resolution/frameworks/java.ts:592–604  ·  view source on GitHub ↗

The index past the string or char literal (or `"""` text block) opening at `i`; -1 when it never closes.

(s: string, i: number)

Source from the content-addressed store, hash-verified

590
591/** The index past the string or char literal (or `"""` text block) opening at `i`; -1 when it never closes. */
592function skipQuoted(s: string, i: number): number {
593 const quote = s[i]!;
594 if (s.startsWith('"""', i)) {
595 const end = s.indexOf('"""', i + 3);
596 return end < 0 ? -1 : end + 3;
597 }
598 for (let j = i + 1; j < s.length; j++) {
599 if (s[j] === '\\') j++;
600 else if (s[j] === quote) return j + 1;
601 else if (s[j] === '\n') return -1;
602 }
603 return -1;
604}
605
606/** The index past the bracketed group opening at `i` — nested groups and literals inside it included; -1 when it never closes. */
607function skipGroup(s: string, i: number): number {

Callers 1

skipGroupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected