The index past the bracketed group opening at `i` — nested groups and literals inside it included; -1 when it never closes.
(s: string, i: number)
| 605 | |
| 606 | /** The index past the bracketed group opening at `i` — nested groups and literals inside it included; -1 when it never closes. */ |
| 607 | function skipGroup(s: string, i: number): number { |
| 608 | const open = s[i]!; |
| 609 | const close = open === '(' ? ')' : open === '[' ? ']' : open === '{' ? '}' : '>'; |
| 610 | let depth = 0; |
| 611 | for (let j = i; j < s.length; j++) { |
| 612 | const c = s[j]!; |
| 613 | if (c === '"' || (c === "'" && open !== '<')) { |
| 614 | const end = skipQuoted(s, j); |
| 615 | if (end < 0) return -1; |
| 616 | j = end - 1; |
| 617 | } else if (c === open) { |
| 618 | depth++; |
| 619 | } else if (c === close && --depth === 0) { |
| 620 | return j + 1; |
| 621 | } |
| 622 | } |
| 623 | return -1; |
| 624 | } |
| 625 | |
| 626 | /** |
| 627 | * The annotation at `at` — `@Name`, `@a.b.Name`, Kotlin's `@field:Name` or |
no test coverage detected