3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-21 15:42:58 +01:00

Ask once whether a line spans, keep base's fallback loop, and decide carries once per pass

This commit is contained in:
2026-11-04 13:08:41 +01:00
committed by Lillem4n
parent 2cbef913d5
commit 395874990c
8 changed files with 133 additions and 101 deletions
@@ -7,7 +7,6 @@ import type { LineContainer } from '../line-container.ts'
import type { PortableLineFallback } from '../emit/inline-line.ts'
import { lineContainer, markedLine, propertyRuns } from '../../conformance/property-harness.ts'
import { judgedLine, portableLeaves, reduceInline, trimmedEdges, withoutFallback } from './inline-reduction.ts'
import { spannedLine } from '../emit/inline-runs.ts'
import { success, type Result } from '../../result.ts'
test('reduces a line alike dropping every run a pass may or the first alone', () => {
@@ -70,7 +69,7 @@ function firstRunLine(nodes: readonly AdfNode[], container: LineContainer): Resu
if (fallback === undefined) return success(line)
const fixed = withoutFallback(line, firstRun(fallback), [])
if (!fixed.ok) return fixed
current = trimmedEdges(fixed.value, spannedLine)
current = trimmedEdges(fixed.value, 'spanned')
}
}