mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-13 04:08:29 +01:00
Pin runEdge's moves give-up with a hand-worked line, and drop item 176
This commit is contained in:
@@ -75,6 +75,12 @@ const lines: { carry?: string[]; drop?: string[]; name: string; nodes: AdfNode[]
|
||||
name: 'a word, strong over nodes 1 and 2, em on node 2, a word after',
|
||||
nodes: [plain('b'), marked(['strong'], '(a'), marked(['strong', 'em'], ')'), plain('c')],
|
||||
},
|
||||
{
|
||||
carry: ['em@2-2'],
|
||||
drop: ['em@2-2'],
|
||||
name: 'a digit, strong and strike over nodes 1 and 2, em on node 2, strong on a digit',
|
||||
nodes: [plain('0'), marked(['strong', 'strike'], '_'), marked(['strong', 'em', 'strike'], '_'), marked(['strong'], '0')],
|
||||
},
|
||||
]
|
||||
|
||||
for (const { carry, drop, name, nodes } of lines) {
|
||||
|
||||
@@ -166,6 +166,7 @@ function mayFlank(sweep: PairSweep, judged: number, character: string, end: 'clo
|
||||
function runEdge(sweep: PairSweep, judged: number, from: number, step: -1 | 1, character: string): string[] | undefined {
|
||||
const found: string[] = []
|
||||
const { delimiters } = touching(sweep, from, step)
|
||||
// Each pair beside adds the characters it may be written with; one that stands ends the run unless it may be written with `character`.
|
||||
for (const at of delimiters) {
|
||||
const other = sweep.pairAt[at] ?? -1
|
||||
const standing = pairStanding(sweep, judged, other)
|
||||
|
||||
Reference in New Issue
Block a user