Skip to content

isRunMetadata's anchorLineShape disjunct is unreachable and can be deleted #260

Description

@mergeconflict

What

isRunMetadata in src/print/list-hazard.ts (l.131 at 423af50) has a second disjunct, anchorLineShape(block) === "anchor", that no input reaches: every spelling anchorLineShape answers "anchor" for ([[id]], [[id, ]], [[id,\t]], [[id,x]], and [[id]] with a trailing tab or NBSP) is intercepted at block start by classifyBlockStart and built as a blockAnchor node, which the first disjunct (isBlockMetadata) already admits, and no paragraph answers "anchor" since splitWords became ASCII-only (#75).

Measured while re-witnessing #73's second paragraph (768 list-item documents, every anchor spelling, 0 failures; a review seat confirmed the structural reason on 2026-09-07).

Ask

Delete the disjunct. Then check whether anchorLineShape's "anchor" value still has a live consumer (src/print/join.ts is the other reader); if not, narrow the function's return type so the dead arm cannot come back. anchorLineShape's own doc refuses to take a node kind's word for the printed line, so the deletion must keep that stance: the consumer trusts isBlockMetadata, not the node kind, and the comment at the site should say why the second question is no longer needed.

Related

#73, #206 (closed by the pins at the same commit), #75.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    foundationFix before new features; other work builds on itmechanism:metadata-stackinga pseudo-anchor or metadata line is stacked onto the wrong blockobligation:completenessa render-equal spelling pair we do not yet normalize

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions