(s: string, idx: number)
| 275 | |
| 276 | // ----- Simple sequence analysis ----- 简单序列分析 |
| 277 | function parseClassInString(s: string, idx: number): number { |
| 278 | idx++; |
| 279 | if (idx < s.length && s[idx] === "^") idx++; |
| 280 | let first = true; |
| 281 | while (idx < s.length) { |
| 282 | const ch = s[idx++]; |
| 283 | if (ch === "\\") { |
| 284 | if (idx >= s.length) return -1; |
| 285 | idx++; |
| 286 | } else if (ch === "]" && !first) { |
| 287 | return idx; |
| 288 | } |
| 289 | first = false; |
| 290 | } |
| 291 | return -1; |
| 292 | } |
| 293 | |
| 294 | interface QuantifierResult { |
| 295 | ok: boolean; |
no outgoing calls
no test coverage detected