ITADN
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):

ModulePathPurpose
dowdiness/diagnosticdiagnostic/Parser-independent structured diagnostics, rendering, and atomic fixes
dowdiness/diagnostic_mojidiagnostic-moji/Opt-in Unicode display-cell rendering adapter for structured diagnostics
dowdiness/diagnostic_prettydiagnostic-pretty/Opt-in width-aware Unicode report layouts with semantic annotations
dowdiness/loomloom/Parser framework: incremental parsing, CST building, grammar composition
dowdiness/seamseam/Language-agnostic CST infrastructure (CstNode / SyntaxNode)
dowdiness/incrincr/Salsa-inspired reactive inputs / derived cells

Sibling modules (see each module's README for scope and status):

ModulePathPurpose
dowdiness/prettypretty/Wadler-Lindig pretty-printer (generic Layout[A], annotations) — used by examples/json
dowdiness/egraphegraph/Equality graph for equality saturation
dowdiness/egglogegglog/Relational e-graph engine (Datalog + equality saturation)
dowdiness/text_changetext-change/Pure contiguous text-change utilities (migrated from canopy 2026-05, #147)
dowdiness/mojimoji/UAX #29 grapheme cluster + word boundary segmentation, UTF-16 indexed (migrated from canopy 2026-05, #147)

Examples

ExamplePathPurpose
Lambda Calculusexamples/lambda/Reference grammar — typed SyntaxNode views, error recovery, CRDT exploration
JSONexamples/json/Step-based prefix_lexer + block_reparse_spec — exercises every Grammar::new option
Markdownexamples/markdown/Mode-aware lexing via ModeLexer — line-start / inline / fenced code contexts
JSXexamples/jsx/Streaming-prefix error recovery — every EOF truncation keeps already-parsed content (generative-UI foundation)
MoonBitexamples/moonbit/Skeleton official MoonBit lexer adapter + coarse Loom CST grammar
Graph DSLexamples/graph-dsl/Source-map/token-role graph authoring example with graph-operation lowering

Documentation