| 348 | const prevWord = (): string => (prevKind === 1 ? source.slice(prevStart, prevEnd) : ''); |
| 349 | const prevChar = (): number => (prevKind === 0 ? 0 : source.charCodeAt(prevEnd - 1)); |
| 350 | const finish = (end: number): number => { |
| 351 | if (stack.length > 0) eligible = false; |
| 352 | for (const group of groups) if (group.item === index) eligible = false; |
| 353 | if (cpp && eligible && tokens > 0) { |
| 354 | // `using namespace std;`, `using std::string;`, `class Foo;`. |
| 355 | if (!sawBrace && !sawParen && !sawAssign && (usingHead || wordsAfterAggregate === 1)) bare = true; |
| 356 | items.push({ start, end, bodyEnd, bare }); |
| 357 | if (!bare) named++; |
| 358 | } else { |
| 359 | edits.length = editsAt; |
| 360 | spans.length = spansAt; |
| 361 | } |
| 362 | return end; |
| 363 | }; |
| 364 | |
| 365 | let j = start; |
| 366 | while (j < n) { |