| 122 | } |
| 123 | |
| 124 | function extractLineRange(input: string) { |
| 125 | const hash = input.lastIndexOf("#") |
| 126 | if (hash === -1) { |
| 127 | return { base: input } |
| 128 | } |
| 129 | |
| 130 | const base = input.slice(0, hash) |
| 131 | const line = input.slice(hash + 1) |
| 132 | const match = line.match(/^(\d+)(?:-(\d*))?$/) |
| 133 | if (!match) { |
| 134 | return { base } |
| 135 | } |
| 136 | |
| 137 | const start = Number(match[1]) |
| 138 | const end = match[2] && start < Number(match[2]) ? Number(match[2]) : undefined |
| 139 | return { base, line: { start, end } } |
| 140 | } |
| 141 | |
| 142 | function slashHead(text: string) { |
| 143 | if (!text.startsWith("/")) { |