3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-20 23:25:43 +01:00

Answer stability round 1: 2 🔴, 7 🟡 (0 misread); look marks up in a Map, judge delimiters by whole code points, report a container's first refusal and test the mutants left

This commit is contained in:
2026-11-17 02:10:06 +01:00
committed by Lillem4n
parent ffb7f1e667
commit 5facc0fc5d
4 changed files with 46 additions and 10 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ export function spelledBlocks(content: readonly AdfNode[]): Result<Map<AdfNode,
if (spelling !== undefined) spelled.set(node, spelling)
} else if (containerHolds(node)) {
pending.push({ exit: true, node, path })
for (const [index, child] of nodeContent(node).entries()) pending.push({ exit: false, node: child, path: [...path, 'content', index] })
const children = nodeContent(node).map((child, index): Step => ({ exit: false, node: child, path: [...path, 'content', index] }))
for (const child of children.reverse()) pending.push(child)
} else {
const spelling = leafSpelling(node, path)
if (!spelling.ok) return spelling