End of stream: a block that never closed is dropped; any other tail is emitted.
()
| 195 | |
| 196 | /** End of stream: a block that never closed is dropped; any other tail is emitted. */ |
| 197 | flush(): string { |
| 198 | const tail = this.buf; |
| 199 | this.buf = ''; |
| 200 | if (this.closeTarget) return ''; |
| 201 | let out = ''; |
| 202 | for (const c of tail) out += this.emit(c); |
| 203 | return out; |
| 204 | } |
| 205 | |
| 206 | private matchOpen(rest: string, lower: string): { close: string; len: number } | 'partial' | null { |
| 207 | const fn = rest.match(FUNCTION_OPEN_RE); |