Emitter 2a: the corpus runner, the canonical serializer and the CommonMark subset
CI / gate (push) Successful in 5s

This commit is contained in:
Mikael Göransson
2026-08-24 15:36:05 +02:00
parent 288ee1697c
commit 0728ea1cfb
16 changed files with 976 additions and 35 deletions
+33
View File
@@ -0,0 +1,33 @@
export type ConvertErrorCode =
| 'ambiguous-empty-code-block-language'
| 'ambiguous-ordered-list-start'
| 'not-an-adf-document'
| 'reserved-adf-language'
| 'unspellable-adjacent-lists'
| 'unspellable-code-block-language'
| 'unspellable-line-start'
| 'unspellable-link-destination'
| 'unspellable-link-title'
| 'unspellable-mark'
| 'unspellable-whitespace'
| 'unspelled-block-marks'
| 'unspelled-node-attribute'
| 'unsupported-document-version'
| 'unsupported-heading-level'
| 'unsupported-node-shape'
| 'unsupported-node-type'
export type ConvertError = {
code: ConvertErrorCode
message: string
}
export type Result<T> = { error: ConvertError; ok: false } | { ok: true; value: T }
export function failure<T>(code: ConvertErrorCode, message: string): Result<T> {
return { error: { code, message }, ok: false }
}
export function success<T>(value: T): Result<T> {
return { ok: true, value }
}