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

Function carriageReturnsIn

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

The `\r`s of `text` in [from, to), which a column doesn't count.

(text: string, from: number, to: number)

Source from the content-addressed store, hash-verified

41
42/** The `\r`s of `text` in [from, to), which a column doesn't count. */
43function carriageReturnsIn(text: string, from: number, to: number): number {
44 let count = 0;
45 for (let k = from; k < to; k++) if (text.charCodeAt(k) === CARRIAGE_RETURN) count++;
46 return count;
47}
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 {

Callers 1

markFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected