The start of the `class` word before index `i`, past whitespace, or -1.
(s: string, i: number)
| 1050 | |
| 1051 | /** The start of the `class` word before index `i`, past whitespace, or -1. */ |
| 1052 | function classBefore(s: string, i: number): number { |
| 1053 | let j = i; |
| 1054 | while (j > 0 && isSpace(s.charCodeAt(j - 1))) j--; |
| 1055 | const w = j - 5; |
| 1056 | return w >= 0 && s.slice(w, j).toLowerCase() === 'class' && (w === 0 || !isIdentPart(s.charCodeAt(w - 1))) ? w : -1; |
| 1057 | } |
| 1058 | |
| 1059 | /** |
| 1060 | * Blank what the Pascal grammar can't parse (see the file comment). Returns |
no test coverage detected