()
| 332 | } |
| 333 | |
| 334 | function commitInterval(): void { |
| 335 | if (intervalStart === undefined) { |
| 336 | return panic("Tried to commit interval without starting one"); |
| 337 | } |
| 338 | assert(i > intervalStart, "Interval must be non-empty"); |
| 339 | // FIXME: This is a hack to avoid splitting up surrogates. We shouldn't |
| 340 | // look at surrogates individually in the first place. When we |
| 341 | // encounter a high surrogate we have to combine it with the low |
| 342 | // surrogate and then do the logic on the code point. Right now we're |
| 343 | // only operating on UTF16 char codes, which is wrong. |
| 344 | if (!atEnd() && isLowSurrogate(currentCodePoint())) { |
| 345 | i += 1; |
| 346 | } |
| 347 | const allUpper = lastLowerCaseIndex === undefined || lastLowerCaseIndex < intervalStart; |
| 348 | intervals.push([intervalStart, i, allUpper]); |
| 349 | intervalStart = undefined; |
| 350 | } |
| 351 | |
| 352 | function intervalLength(): number { |
| 353 | if (intervalStart === undefined) { |
no test coverage detected
searching dependent graphs…