Skip to content

Let a spec reach the items nested inside a block - #79

Merged
peterbjohnson merged 7 commits into
devfrom
wb/t51
Sep 21, 2026
Merged

peterbjohnson merged 7 commits into
devfrom
wb/t51

Conversation

@peterbjohnson

Copy link
Copy Markdown
Member

in2lambda source add records one block per top-level element of the markdown. A list item is one block from its marker to the end of everything nested under it, so a sheet written as \begin{enumerate} \item Q1 ... \begin{enumerate} \item (a) ... \item (b) ... \end{enumerate} \end{enumerate} (three of the four filter examples, and most tex sheets in the corpus) gives a spec one block per question and nothing to match a part against. t49 found this: part: ListItem reaches top-level items only.

Record nested elements as blocks too. In in2lambda.source, walk each list item's children with sourcepos and record the nested list items, and the paragraphs of an item that holds nested lists, as blocks with ids that say where they sit (b3.1, b3.2, b3.2.1), each with its own line range and a depth. A parent block's range still spans its children. source show prints the nested ids indented. A spec selector reaches them: part: ListItem depth=2, and the existing after clause pairs a nested part with the question above it; question: ListItem depth=1 keeps matching the parent. The coverage check counts a line as accounted for when any field or ignore mark covers it, so a question field quoted from a parent block whose children are parts is reported as an overlap only where two fields claim the same lines - state the rule you choose in the docs: a parent quoted whole and its children quoted too is a double assignment, so the spec quotes the parent's own paragraphs (b3.1) into the question and the nested items into the parts. Update tests/fixtures/specs for the three nested layouts so that each filter example is spec-able, and add the nested case to docs/source/spec.md and drafts.md.

Done when spec run with the updated fixture specs assigns every block of PartsSepSol, PartPartSolSol and PartSolPartSol's example.tex, draft replay of an existing flat draft is unchanged, and the t49 test passes on the spec route for all four layouts.


Workbench ticket t51.

@peterbjohnson
peterbjohnson merged commit b5db6da into dev Sep 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant