(pattern: RegExp)
| 75 | |
| 76 | /** Advances past a sticky pattern at `i`, returning the matched length. */ |
| 77 | const run = (pattern: RegExp) => { |
| 78 | pattern.lastIndex = i |
| 79 | const length = pattern.test(text) ? pattern.lastIndex - i : 0 |
| 80 | i += length |
| 81 | return length |
| 82 | } |
| 83 | |
| 84 | const word = <A>(literal: string, result: A): A => { |
| 85 | if (!text.startsWith(literal, i)) { |
no outgoing calls
no test coverage detected