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