Skip to content

Lines and Join are the same rule, so they are exported rather than copied - #19

Merged
tannevaled merged 1 commit into
mainfrom
lines-and-join-are-the-same-rule-twice
Oct 12, 2026
Merged

tannevaled merged 1 commit into
mainfrom
lines-and-join-are-the-same-rule-twice

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

go-pdfkit/document has to know where
a paragraph ends and which line is a heading, and both questions start from the
lines of a page.

Writing a second line-grouping rule there would mean two rules that must
agree about what a page says, with nothing to make them
. So Text's own rule
is exported instead:

lines := extract.Lines(runs)     // the runs gathered into their lines
s     := extract.Join(lines[0])  // one line's pieces, spaced as words

The test is the agreement itself — Lines joined with Join must read exactly
what Assemble reads. A copy could pass its own tests and still disagree.

Two one-line wrappers over groupIntoLines and joinLine, which already did
this for Text. 100% of statements, no uncovered blocks.

🤖 Generated with Claude Code

…pied

go-pdfkit/document has to know where a paragraph ends and which line is a
heading, and both questions start from the lines of a page. Writing a second
line-grouping rule there would mean two rules that must agree about what a
page says, with nothing to make them -- so Text's own rule is exported
instead.

The test is the agreement itself: Lines joined with Join must read exactly
what Assemble reads. A copy could pass its own tests and still disagree.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 9b632b2 into main Oct 12, 2026
1 check passed
@tannevaled
tannevaled deleted the lines-and-join-are-the-same-rule-twice branch October 12, 2026 07:16
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