Streaming Markdown File
Mutable AST node that accept appending chunks.
THIS INSTANCE IS NOT CONCURRENT SAFE. NEVER ACCESS IT CONCURRENTLY.
When append is called, only the unstableTail part will be reparsed. The only way to update its state is to invoke append. Then endOffset, stableChildren, unstableTail and children will be updated.
To avoid memory leak, it doesn't hold the whole original Markdown string. The caller may accumulate the original string outside the StreamingMarkdownFile.
After each append, StreamingMarkdownFile represents a complete Markdown document ending at the current offset.
Properties
The accumulated stable part of the Markdown file.
The unstable part of the Markdown file. It may be updated by append. Every append will reparse this part. If some part of unstableTail gets stable, it will be removed and appended to stableChildren.