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

Function literalEnd

src/resolution/cpp-raw-strings.ts:50–59  ·  view source on GitHub ↗

Where a string or character literal opened at `open` ends: past its closing quote, or at the end of the line.

(text: string, open: number, quote: number)

Source from the content-addressed store, hash-verified

48
49/** Where a string or character literal opened at `open` ends: past its closing quote, or at the end of the line. */
50function literalEnd(text: string, open: number, quote: number): number {
51 const n = text.length;
52 let k = open + 1;
53 for (; k < n; k++) {
54 const c = text.charCodeAt(k);
55 if (c === quote || c === NEWLINE) break;
56 if (c === BACKSLASH) k++;
57 }
58 return Math.min(n, text.charCodeAt(k) === quote ? k + 1 : k);
59}
60
61/**
62 * The 1-based lines of a C or C++ file that raw string literals or block

Callers 1

cppNonCodeLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected