5b1: name the line and the offset in the input a parse refusal sits at

This commit is contained in:
2026-09-03 14:37:39 +02:00
parent becc023b51
commit d3888129b0
10 changed files with 146 additions and 66 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import type { BlockDirectiveNode } from './directive-nodes.ts'
import type { LinkDefinitions } from './inline-content.ts'
import { carryName, readCarriedBlock } from '../opaque-carry.ts'
import { commonMarkSpelling } from '../emit/adf-to-markdown.ts'
import { failure, faulted, success, type ConvertErrorPath, type Result } from '../../result.ts'
import { failure, faulted, positioned, success, type ConvertErrorPath, type Result } from '../../result.ts'
import { languageSlot } from '../code-language.ts'
import { largestNesting } from '../../nesting.ts'
import { parseBlocks } from './blocks.ts'
@@ -22,7 +22,7 @@ function blockNodes(blocks: readonly Block[], definitions: LinkDefinitions, path
if (depth > largestNesting) return failure('unsupported-nesting-depth', `the input nests deeper than the ${largestNesting} levels the parser carries`, path)
const content: AdfNode[] = []
for (const [index, block] of blocks.entries()) {
const node = blockNode(block, definitions, [...path, 'content', index], depth)
const node = positioned(blockNode(block, definitions, [...path, 'content', index], depth), block.position)
if (!node.ok) return node
content.push(node.value)
}