The start of the identifier that ends at `i`, or -1 when none does.
(s: string, i: number)
| 205 | |
| 206 | /** The start of the identifier that ends at `i`, or -1 when none does. */ |
| 207 | function wordStartBefore(s: string, i: number): number { |
| 208 | let k = i; |
| 209 | while (k > 0 && isIdentPart(s.charCodeAt(k - 1))) k--; |
| 210 | if (k === i) return -1; |
| 211 | if (k > 0 && s.charCodeAt(k - 1) === CH_AMP) k--; |
| 212 | return isIdentStart(s.charCodeAt(k)) ? k : -1; |
| 213 | } |
| 214 | |
| 215 | /** The index after the first `;` from `i` outside parentheses and brackets, or -1 when none comes within `max` characters. */ |
| 216 | function semicolonEnd(s: string, i: number, max: number): number { |
no test coverage detected