The start of the `class` word before index `i`, past whitespace, or -1.
(s: string, i: number)
| 980 | |
| 981 | /** The start of the `class` word before index `i`, past whitespace, or -1. */ |
| 982 | function classBefore(s: string, i: number): number { |
| 983 | let j = i; |
| 984 | while (j > 0 && isSpace(s.charCodeAt(j - 1))) j--; |
| 985 | const w = j - 5; |
| 986 | return w >= 0 && s.slice(w, j).toLowerCase() === 'class' && (w === 0 || !isIdentPart(s.charCodeAt(w - 1))) ? w : -1; |
| 987 | } |
| 988 | |
| 989 | /** |
| 990 | * Blank what the Pascal grammar can't parse (see the file comment). Returns |
no test coverage detected