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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user