MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / lineCol

Function lineCol

src/common/parser.ts:41–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }
40
41 get lineCol(): { line: number; col: number } {
42 const start = this.pos;
43 this.pos = 0;
44 let line = 1;
45 let col = 1;
46 while (this.pos < start) {
47 if (this.atLineEnd) {
48 line++;
49 col = 1; // Reset column on new line
50 } else {
51 this.consume();
52 col++;
53 }
54 }
55 return { line, col };
56 }
57
58 getLine(line: number): string | undefined {
59 if (line < 1) return undefined; // Lines are 1-indexed

Callers

nothing calls this directly

Calls 1

consumeMethod · 0.80

Tested by

no test coverage detected