(text: string)
| 449 | let firstId = ""; |
| 450 | |
| 451 | function addStmt(text: string) { |
| 452 | // `text` is sliced from `cleaned`, so it's already fence/comment-free. |
| 453 | const t = text.trim(); |
| 454 | if (!t) return; |
| 455 | for (const s of split(tokenize(t))) { |
| 456 | const expr = parseExpression(s.tokens); |
| 457 | const stmt = classifyStatement(s, expr); |
| 458 | completedStmtMap.set(s.id, stmt); |
| 459 | completedCount++; |
| 460 | if (!firstId) firstId = s.id; |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | // Recompute `cleaned` from `buf`. If the already-completed prefix is no longer |
| 465 | // a prefix of the new cleaned text (e.g. an opening ```fence``` just appeared |
no test coverage detected