Skip to content

0.6.0 — Full AST engine

Choose a tag to compare

@luca-chen198 luca-chen198 released this 04 Jun 15:47
d28c606

Highlights

Replaces the regex-driven Markdown engine with a full AST pipeline — parsing, tokenizing, and styling now run off a real syntax tree instead of re-scanning the whole document with NSRegularExpression on every keystroke.

Main changes

  • Two-phase AST parseBlockParser splits the document into a gap-free sequence of blocks; each block's inline content is parsed by InlineParser into a DocumentAST (BlockNodes with inline children).
  • Tables & block LaTeX as first-class AST blocks — with a table-cell scanner that reuses the inline parser, instead of regex detection.
  • AST visitor styler — block paragraph styles, inline colouring, and caret-aware marker reveal/shrink all derive from the tree; this is the live styler now, not the old regex passes.
  • Scanners instead of regex — block-level tokens come from hand-written scanners; the structural regexes in the tokenizer and styler are gone.
  • Incremental parsing & tokenization — per keystroke only the edited block window is re-parsed/re-tokenized (prefix/suffix reuse + buffer memcmp cache, wiki-link fast path), so editing cost is ≈ O(edit) instead of O(document).

Bundled fixes

Heading marker spacing & nested-marker reveal, task-checkbox glyph, file-switch scroll oscillation, incomplete code fences staying visible while typing, and trailing-image scroll/measurement.

Tests

swift test — 61 tests across the AST parser, styler, and end-to-end pipeline suites.

Full changelog: 0.5.1...0.6.0

What's Changed

Full Changelog: 0.5.1...0.6.0