3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-14 04:30:24 +01:00

36c - review: a Deno premise that holds today, the plain reduction's memo named

This commit is contained in:
2026-09-28 11:14:27 +02:00
parent e7a464d4d8
commit eaa55d923d
3 changed files with 18 additions and 14 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ type BlockSpelling = 'commonmark' | 'directive' | 'list'
type EmittedBlock = { headroom: number; spelling: BlockSpelling; text: string }
type KeptSpelling = { block: EmittedBlock | undefined; depth: number }
type PlacedBlock = Omit<EmittedBlock, 'headroom'> & { node: AdfNode }
// Keyed by reference: the parse builds one object per position; a consumer's document may share one, so adfToMarkdown passes none.
// Keyed by reference: only a caller building one object per position (the parse, the plain reduction) passes one; a consumer's document may share a node.
export type SpellingMemo = Map<AdfNode, KeptSpelling>
type Walk = { blocks: readonly PlacedBlock[]; headroom: number }
type WalkedItem = { node: AdfNode; walk: Walk }