* The kind of statement position the token from `at` to `end` makes for what follows it: 1 for a case label's * `:`, 0 for `then`, `else` or `do`, -1 for anything else.
(s: string, at: number, end: number)
| 834 | * `:`, 0 for `then`, `else` or `do`, -1 for anything else. |
| 835 | */ |
| 836 | function statementPosition(s: string, at: number, end: number): number { |
| 837 | const length = end - at; |
| 838 | if (length === 1) return s.charCodeAt(at) === CH_COLON ? 1 : -1; |
| 839 | if (length < 2 || length > 4) return -1; |
| 840 | const word = s.slice(at, end).toLowerCase(); |
| 841 | return word === 'then' || word === 'else' || word === 'do' ? 0 : -1; |
| 842 | } |
| 843 | |
| 844 | /** |
| 845 | * The start of the declaration that the `record` keyword at `i` gives an |