A `line:column` branch as one number, for ordering constructs by where they start.
(branch: string)
| 229 | |
| 230 | /** A `line:column` branch as one number, for ordering constructs by where they start. */ |
| 231 | function at(branch: string): number { |
| 232 | const [line, column] = branch.split(':'); |
| 233 | return (Number(line) || 0) * 10000 + (Number(column) || 0); |
| 234 | } |
| 235 | |
| 236 | function sameScope(open: Open, scope: Scope): boolean { |
| 237 | if (open.branch !== scope.branch) return false; |