3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 06:35:44 +01:00

Give the directive grammar, flavours and reader failures one place each

This commit is contained in:
2026-10-21 23:43:05 +02:00
committed by Lillem4n
parent db10287cae
commit b080410852
37 changed files with 212 additions and 189 deletions
+12 -14
View File
@@ -1,15 +1,15 @@
import type { AttributeKind, VocabularyPair, VocabularyValue } from '../adf/attribute-vocabulary.ts'
import type { CodeSpanCloser } from './commonmark/backtick-runs.ts'
import type { ConvertFault } from '../result.ts'
import type { InlineSource } from './inline-tokens.ts'
import type { JsonValue } from '../json-value.ts'
import { backslashEscape, holdsNullCharacter } from './commonmark/grammar.ts'
import { backtickRun } from './commonmark/backtick-runs.ts'
import { isNumberList } from '../adf/attribute-vocabulary.ts'
import { overNested } from '../json-value.ts'
import { largestNesting } from '../nesting.ts'
import { parseJsonText } from '../json-text.ts'
import { serializeCanonicalJson } from '../canonical-json.ts'
import type { AttributeKind, VocabularyPair, VocabularyValue } from '../../adf/attribute-vocabulary.ts'
import type { CodeSpanCloser } from '../commonmark/backtick-runs.ts'
import type { ConvertFault, Read } from '../../result.ts'
import type { InlineSource } from '../inline-tokens.ts'
import type { JsonValue } from '../../json-value.ts'
import { backslashEscape, holdsNullCharacter } from '../commonmark/grammar.ts'
import { backtickRun } from '../commonmark/backtick-runs.ts'
import { isNumberList } from '../../adf/attribute-vocabulary.ts'
import { overNested } from '../../json-value.ts'
import { largestNesting } from '../../nesting.ts'
import { parseJsonText } from '../../json-text.ts'
import { serializeCanonicalJson } from '../../canonical-json.ts'
export type AttributeReading = { refusal: 'kind' | 'nesting'; value?: undefined } | { refusal?: undefined; value: VocabularyValue }
@@ -31,8 +31,6 @@ export type DirectiveSpan = { attributes: DirectiveAttributes; content: string |
export type NestedSpans = ReadonlyMap<number, DirectiveSpan>
export type Read<T> = { fault: ConvertFault; value?: undefined } | { fault?: undefined; value: T }
type AttributePair = { end: number; key: string; value: DirectiveValue }
type Content = { content: string | undefined; end: number; spans: NestedSpans }