3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +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
+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