3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-13 04:08:29 +01:00

Answer architecture round 3: the comprehension floor's decision names item 95, the directive read takes its index from the claimed prefix, and only the claimed prefix leaves directive-syntax.ts

This commit is contained in:
2026-10-09 18:46:56 +02:00
committed by Lillem4n
parent af9b0d082c
commit 3e9c56d399
5 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ In `docs/decisions.md`:
- Firefox reads the build
- The coverage floors
- The size ratchet
- The project ships under the comprehension floor until items 59, 60 and 62 land
- The project ships under the comprehension floor until items 59, 60, 62 and 95 land
- Properties on a fixed seed
- The CommonMark suite checks three ways
- The flavour spec is read as a source
+2 -2
View File
@@ -570,10 +570,10 @@ config gone missing fails the leg instead of falling back to oxlint's own defaul
`--deny-warnings`, since a rule from a category this config never names arrives as a warning it
exits 0 on.
## The project ships under the comprehension floor until items 59, 60 and 62 land
## The project ships under the comprehension floor until items 59, 60, 62 and 95 land
2026-10-03, the maintainer. KISS, a technical principle, and its comprehension floor of 7. Valid
while `todo.md` items 59, 60 and 62 are open.
while `todo.md` items 59, 60, 62 and 95 are open.
A four-seat comprehension panel scored the project under the floor of 7. Its scoring run of
2026-10-08 is the baseline. Since 2026-10-04, a chunk whose panel scores any
+4 -4
View File
@@ -75,10 +75,6 @@ export function claimDirectivePrefix(text: string, index: number): ClaimedPrefix
return claimsDirectivePrefix(text, index) ? { [claimedPrefix]: true, index } : undefined
}
export function claimsDirectivePrefix(text: string, index: number): boolean {
return text.startsWith(directivePrefix, index)
}
export function holdsDirectivePrefix(text: string): boolean {
return text.includes(directivePrefix)
}
@@ -164,6 +160,10 @@ export function unsupportedNodeShape(message: string): ConvertFault {
return { code: 'unsupported-node-shape', message }
}
function claimsDirectivePrefix(text: string, index: number): boolean {
return text.startsWith(directivePrefix, index)
}
function keyOrder(left: string, right: string): number {
if (left < right) return -1
return left > right ? 1 : 0
+5 -5
View File
@@ -119,7 +119,7 @@ function scanInline(scan: Scan): Result<Scanned> {
}
function readToken(scan: Scan, index: number, token: InlineToken): Result<number> {
if (token.kind === 'directive') return readDirective(scan, index, token.prefix)
if (token.kind === 'directive') return readDirective(scan, token.prefix)
if (token.kind === 'html') return failure('unmappable-html', `no raw HTML converts at this version: ${token.construct}`, scan.path)
const end = index + token.width
switch (token.kind) {
@@ -168,12 +168,12 @@ function readLineEnding(scan: Scan, index: number): number {
return index + 1
}
function readDirective(scan: Scan, index: number, prefix: ClaimedPrefix): Result<number> {
const held = scan.spans.get(index)
if (held !== undefined) return pushDirective(scan, held, index)
function readDirective(scan: Scan, prefix: ClaimedPrefix): Result<number> {
const held = scan.spans.get(prefix.index)
if (held !== undefined) return pushDirective(scan, held, prefix.index)
const directive = readInlineDirective(scan.source, prefix)
if (directive.fault !== undefined) return faulted(directive.fault, scan.path)
return pushDirective(scan, directive.value, index)
return pushDirective(scan, directive.value, prefix.index)
}
function pushDirective(scan: Scan, span: DirectiveSpan, index: number): Result<number> {
+1 -1
View File
@@ -52,7 +52,7 @@
| 52 | 0.3.0 | | **Spell `colwidth` as a comma list, `colwidth="340,420"`.** | 3 | 3 | 5 | 6 | 6 | 11.5 |
| 51 | 0.3.0 | | **Match a reference label to its definition under Unicode case folding.** | 2 | 2 | 2 | 7 | 4, 5 | 10.9 |
| 53 | 0.3.0 | | **Put a block's `marks` spelling to the writer panel and adopt its pick.** | 4 | 5 | 5 | 6 | 6 | 10.0 |
| 95 | 0.3.0 | | **Find the code-span closers an escape forms and the mark runs a line cannot spell by reading the line back, in place of `escapeClosedRuns` and `unspellableRuns` predicting them.** | 5 | 6 | 2 | 6 | 1 | 9.5 |
| 95 | 0.3.0 | decision | **Find the code-span closers an escape forms and the mark runs a line cannot spell by reading the line back, in place of `escapeClosedRuns` and `unspellableRuns` predicting them.** | 5 | 6 | 2 | 6 | 1 | 9.5 |
| 91 | 0.3.0 | | **Spell an emphasis or link once across the hard breaks between two nodes it marks, in both writers.** | 5 | 5 | 5 | 6 | 6 | 9.0 |
| 73 | 0.4.0 | | **Announce the package where someone needing an ADF converter already reads: JRACLOUD-77436, the Atlassian developer community and Stack Overflow's ADF-to-markdown questions.** | 1 | 2 | 6 | 8 | 3 | 23.0 |
| 9 | 0.4.0 | | **Ship an online sandbox: a web page with two textboxes converting between ADF and markdown on the library's browser build.** | 2 | 6 | 6 | 8 | 3 | 21.0 |