Add the names `text` writes right before a `<`.
(text: string, names: Set<string>)
| 290 | |
| 291 | /** Add the names `text` writes right before a `<`. */ |
| 292 | function addNamesBeforeAngle(text: string, names: Set<string>): void { |
| 293 | for (let open = text.indexOf('<'); open >= 0; open = text.indexOf('<', open + 1)) { |
| 294 | let end = open; |
| 295 | while (end > 0 && isSpace(text.charCodeAt(end - 1))) end--; |
| 296 | let start = end; |
| 297 | while (start > 0 && isWord(text.charCodeAt(start - 1))) start--; |
| 298 | if (start < end) names.add(text.slice(start, end)); |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | /** The qualifiers `A<T>::B::` written right before `end`, outermost first, each with the arguments it writes. */ |
| 303 | function qualifiersBefore(text: string, end: number): Array<{ name: string; args: string[] | null }> { |