dowdiness/loom · 文件
文件最后提交记录最后更新时间
README.md
Loom
A generic incremental parser framework for MoonBit — edit-aware lexing, a lossless green tree
(CST), subtree reuse, error recovery, and a reactive pipeline. Any grammar plugs in via a single Grammar[T, K, Ast] value.
New here? Start with the dowdiness/loom package README for the API and a Quick Start, then browse the docs index.
Quick Start
Monorepo — no root moon.mod.json; run moon from each module's directory. incr, egraph, egglog, and event-graph-walker are git submodules, so clone with --recursive:
git clone --recursive https://github.com/dowdiness/loom.git && cd loom
moon update # fetch the package registry index
(cd loom && moon test) # framework module (loom/)
(cd examples/lambda && moon test) # lambda example
(cd examples/lambda && moon bench --release)
Multi-module development workflow: docs/development/managing-modules.md.
Modules
Core framework (stable):
| Module | Path | Purpose |
|---|---|---|
dowdiness/diagnostic | diagnostic/ | Parser-independent structured diagnostics, rendering, and atomic fixes |
dowdiness/diagnostic_moji | diagnostic-moji/ | Opt-in Unicode display-cell rendering adapter for structured diagnostics |
dowdiness/diagnostic_pretty | diagnostic-pretty/ | Opt-in width-aware Unicode report layouts with semantic annotations |
dowdiness/loom | loom/ | Parser framework: incremental parsing, CST building, grammar composition |
dowdiness/seam | seam/ | Language-agnostic CST infrastructure (CstNode / SyntaxNode) |
dowdiness/incr | incr/ | Salsa-inspired reactive inputs / derived cells |
Sibling modules (see each module's README for scope and status):
| Module | Path | Purpose |
|---|---|---|
dowdiness/pretty | pretty/ | Wadler-Lindig pretty-printer (generic Layout[A], annotations) — used by examples/json |
dowdiness/egraph | egraph/ | Equality graph for equality saturation |
dowdiness/egglog | egglog/ | Relational e-graph engine (Datalog + equality saturation) |
dowdiness/text_change | text-change/ | Pure contiguous text-change utilities (migrated from canopy 2026-05, #147) |
dowdiness/moji | moji/ | UAX #29 grapheme cluster + word boundary segmentation, UTF-16 indexed (migrated from canopy 2026-05, #147) |
Examples
| Example | Path | Purpose |
|---|---|---|
| Lambda Calculus | examples/lambda/ | Reference grammar — typed SyntaxNode views, error recovery, CRDT exploration |
| JSON | examples/json/ | Step-based prefix_lexer + block_reparse_spec — exercises every Grammar::new option |
| Markdown | examples/markdown/ | Mode-aware lexing via ModeLexer — line-start / inline / fenced code contexts |
| JSX | examples/jsx/ | Streaming-prefix error recovery — every EOF truncation keeps already-parsed content (generative-UI foundation) |
| MoonBit | examples/moonbit/ | Skeleton official MoonBit lexer adapter + coarse Loom CST grammar |
| Graph DSL | examples/graph-dsl/ | Source-map/token-role graph authoring example with graph-operation lowering |
Documentation
- docs/README.md — navigation index (start here, architecture, API, archive)
- ROADMAP.md — phase status and future work
- CHANGELOG.md — user-facing changes