* 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)
| 904 | * `:`, 0 for `then`, `else` or `do`, -1 for anything else. |
| 905 | */ |
| 906 | function statementPosition(s: string, at: number, end: number): number { |
| 907 | const length = end - at; |
| 908 | if (length === 1) return s.charCodeAt(at) === CH_COLON ? 1 : -1; |
| 909 | if (length < 2 || length > 4) return -1; |
| 910 | const word = s.slice(at, end).toLowerCase(); |
| 911 | return word === 'then' || word === 'else' || word === 'do' ? 0 : -1; |
| 912 | } |
| 913 | |
| 914 | /** |
| 915 | * The start of the declaration that the `record` keyword at `i` gives an |