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

Function skipQuoted

src/resolution/frameworks/java.ts:594–606  ·  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

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

Callers 1

skipGroupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected