(start: number, end: number)
| 1770 | const reads = [...moving.keys()].sort((l, r) => l.id.start - r.id.start) |
| 1771 | // a span's text with each read within it written as what it reads |
| 1772 | const textOf = (start: number, end: number): string => { |
| 1773 | let text = "" |
| 1774 | for (const read of reads) { |
| 1775 | if (read.id.start < start || read.id.end > end) continue |
| 1776 | text += code.slice(start, read.id.start) + writtenAt(read) |
| 1777 | start = read.id.end |
| 1778 | } |
| 1779 | return text + code.slice(start, end) |
| 1780 | } |
| 1781 | const writtenAt = (read: Reference) => { |
| 1782 | const { init } = moving.get(read)! |
| 1783 | const text = textOf(init!.start, init!.end) |
no test coverage detected