Skip to content

docs(screen): list the shapes Screen::parse reads beside the canonical ones - #879

Merged
vyncint merged 3 commits into
vyncint:mainfrom
alvaroalonsoparrondo-a11y:docs/screen-parse-tolerances
Nov 27, 2026
Merged

vyncint merged 3 commits into
vyncint:mainfrom
alvaroalonsoparrondo-a11y:docs/screen-parse-tolerances

Conversation

@alvaroalonsoparrondo-a11y

@alvaroalonsoparrondo-a11y alvaroalonsoparrondo-a11y commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #849

Screen::parse's rustdoc and DESIGN §3 said it accepts "exactly" what Display and with_styles write, and that everything else is an Error::Parse. It also reads every shape in the issue's right-hand column. As the issue says, the tolerances do no harm and STABILITY promises that a file from 0.10.1 on keeps parsing, so I took the first option: the docs now say what is read, and the grammar is unchanged.

  • crates/termlens/src/screen/parse.rs: the rustdoc lists the extra shapes (a + before a number in the header, one space or none before cursor:, a row's spans split over several lines, blank lines between span lines, (none) after spans, 0-0, a token repeated or out of order, a span with no token) and says a file that parses is not proof termlens wrote it.
  • docs/DESIGN.md §3: "Reading it back" gets the same list, without "exactly", and why the tolerances stay; "What a reader skips" points to it instead of saying "accepts exactly that".
  • Test: the_reader_accepts_these_shapes_beside_the_canonical_ones in parse.rs reads one input per table row (two for the header spacing) and checks that each gives the same screen as its canonical form (diff empty, same with_styles() text).
  • CHANGELOG: entry under Unreleased → Fixed.

Checked on macOS: cargo fmt --all --check, cargo clippy -p termlens --all-targets --all-features -- -D warnings, cargo test -p termlens --lib screen::parse (15 passed), the parse doctest, check-dco.sh and check-no-ai-attribution.sh.

Álvaro Alonso
242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com

…l ones

Fixes vyncint#849

Signed-off-by: Álvaro Alonso <242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com>
Signed-off-by: Álvaro Alonso <242080768+alvaroalonsoparrondo-a11y@users.noreply.github.com>
vyncint
vyncint previously approved these changes Nov 27, 2026

@vyncint vyncint left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against the issue; CI is green. Thank you.

Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
@vyncint
vyncint merged commit b572ae7 into vyncint:main Nov 27, 2026
17 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.

Screen::parse accepts size: +4x+1 cursor: +0,+0 and other shapes its docs say it refuses

2 participants