(to: number)
| 76 | let line = 1; |
| 77 | let lineStart = 0; |
| 78 | const seek = (to: number): void => { |
| 79 | for (let nl = text.indexOf('\n', lineStart); nl >= 0 && nl < to; nl = text.indexOf('\n', lineStart)) { |
| 80 | line++; |
| 81 | lineStart = nl + 1; |
| 82 | } |
| 83 | }; |
| 84 | // Mark [from, to) of the text, which may span lines, as raw string contents. |
| 85 | const mark = (from: number, to: number): void => { |
| 86 | seek(from); |