(wire: readonly WireToken[], classes: readonly string[])
| 76 | * a silent mis-underline rather than a visible error. |
| 77 | */ |
| 78 | export function decodeLine(wire: readonly WireToken[], classes: readonly string[]): Token[] { |
| 79 | const out: Token[] = []; |
| 80 | let col = 0; |
| 81 | for (const [id, text] of wire) { |
| 82 | const name = classes[id]; |
| 83 | out.push({ cls: CLASS_NAMES.has(name as string) ? (name as TokenClass) : 'other', text, col }); |
| 84 | col += text.length; |
| 85 | } |
| 86 | return out; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Split a line into identifier runs with no syntax classification at all. |