12b: the inline directive forms read and spell the !adf: prefix
CI / gate (push) Successful in 26s
CI / publish (push) Has been skipped

This commit is contained in:
2026-09-16 09:52:52 +02:00
parent fe064efdb9
commit 302804cc4e
66 changed files with 397 additions and 329 deletions
+7 -7
View File
@@ -64,13 +64,16 @@ function parseInline(source: string, definitions: LinkDefinitions, path: Convert
index = angle.value
break
}
case ':': {
case '!': {
const directive = readDirective(scan, index)
if (directive === undefined) {
index = openBracket(scan, index)
break
}
if (!directive.ok) return directive
index = directive.value
break
}
case '!':
case '[':
index = openBracket(scan, index)
break
@@ -151,12 +154,9 @@ function openBracket(scan: Scan, index: number): number {
return index + width
}
function readDirective(scan: Scan, index: number): Result<number> {
function readDirective(scan: Scan, index: number): Result<number> | undefined {
const directive = readInlineDirective(scan.source, index)
if (directive === undefined) {
scan.pending += ':'
return success(index + 1)
}
if (directive === undefined) return undefined
if (directive.fault !== undefined) return faulted(directive.fault, scan.path)
const piece = directivePiece(scan, directive.value)
if (!piece.ok) return piece