mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-18 22:25:44 +01:00
Answer stability round 1: 0 🔴, 3 🟡 (0 misread); state item 190 for every run crossing a hard break, name trimmingRuns in the decision, say the run reaches between its non-blank holders
This commit is contained in:
+1
-1
@@ -813,7 +813,7 @@ grouping, with the span rule in one home. `inlineRuns` in `emit/inline-runs.ts`
|
||||
says which node a run passes, and a run ends at its last holder. The writer tries the spanned line once and, where it needs any
|
||||
fallback, runs its fallback loop on the parted line, so `takeFallback` takes what it is handed; whether a node is carried is
|
||||
decided once per pass, on its `RunNode` (the restructure of 2026-11-04). The reducer judges the same two lines, each trimmed by
|
||||
its own runs, which `runsSharedWithNext` counts beside `inlineRuns`. `withoutOpeningLinkCode`
|
||||
its own runs, which `trimmingRuns` counts beside `inlineRuns`. `withoutOpeningLinkCode`
|
||||
stays on `insideRun` alone, since it answers the parted line. A refactor that merges as its own chunk took its own ruling,
|
||||
so the chunk's later rulings read against that merge, the commit `larv-review ruling-base` prints. A restructure past a
|
||||
pass's round cap still goes unreviewed, so the PR summary names it.
|
||||
|
||||
@@ -250,7 +250,7 @@ function edgeOutcome(marks: readonly AdfMark[], { lineEdge, sharedRuns }: Beside
|
||||
return depth === 0 && lineEdge ? { kind: 'drop' } : { depth, kind: 'keep' }
|
||||
}
|
||||
|
||||
// For each leaf but the last, how many of `grouping`'s runs hold it and the next leaf; an edge-stripping mark's run spans only its leaves holding more than spaces and tabs, as the trim strips the mark off blank leaves past them, else one pass each.
|
||||
// For each leaf but the last, how many of `grouping`'s runs hold it and the next leaf; an edge-stripping mark's run reaches only from its first to its last non-blank holder, since the trim strips the mark off the blank holders outside, one pass each if they counted.
|
||||
export function trimmingRuns(leaves: readonly AdfNode[], grouping: RunGrouping): number[] {
|
||||
const shared = leaves.map(() => 0)
|
||||
countTrimmingRuns(leaves.map((node) => ({ carried: false, node, outer: 0 })), 0, grouping, shared)
|
||||
|
||||
@@ -52,8 +52,10 @@ edge, and only then is its neighbour at the edge. Blank leaves alternating linke
|
||||
a hard break, then a linked leaf, take n + 1 passes: 101, 1 001 and 10 001 at n = 100, 1 000 and
|
||||
10 000, so the trim is quadratic, against goal 9. An unmarked blank drops at the edge; a linked blank
|
||||
drops once the link run crosses the hard break to the linked leaf, which the unmarked blank between
|
||||
breaks until it drops. Item 174's truncated runs leave this cascade as it was, since a link doesn't
|
||||
strip edge whitespace. Count passes to measure, never time (§Cost fixes are measured, never timed).
|
||||
breaks until it drops. Any run crossing a hard break cascades the same way, one blank per pass, an em
|
||||
run too: `'a'` em, a hard break, blanks alternating em and `[em, link]`, then `'b'` em take 7, 101 and
|
||||
1 001 passes at n = 6, 100 and 1 000. Item 174's runs, counted between their non-blank holders, leave
|
||||
these blanks inside. Count passes to measure, never time (§Cost fixes are measured, never timed).
|
||||
Found by item 174's chunk, 2026-11-15.
|
||||
|
||||
### 51. Match a reference label to its definition under Unicode case folding.
|
||||
|
||||
Reference in New Issue
Block a user