Commit 8117c4d
committed
Add native terminfo reader; reconstruct tigetstr/tigetnum/tigetflag
The wisest next move: a real terminfo substrate, so the crate's hardcoded xterm
byte sequences are derived from the compiled terminfo entry instead of asserted.
src/terminfo/:
- A dependency-free reader for the compiled terminfo binary format (legacy i16
and 32-bit-number magics; names, booleans, even-offset pad, numbers, string
table). Pure, never panics, #![forbid(unsafe_code)] preserved.
- tigetflag/tigetnum/tigetstr with ncurses' exact return semantics
(present / absent / cancelled / not-a-capability).
- caps.rs: canonical capability-name tables CODEGENNED by `cargo xtask gen`
from docs-src/models/terminfo-caps.json (extracted from ncurses' own
boolnames/numnames/strnames). The freshness gate now covers codegen too.
Evidence (multiple oracles + fixture):
- tests/terminfo/xterm: committed xterm entry (sha 83fc9790) for hermetic tests.
- NCURSES.TERMINFO.LOOKUP: crate tiget* vs ncurses' own tiget* over ALL 497
standard caps (44 bool + 39 num + 414 str), TERMINFO pinned to the fixture,
admitted_match with zero diffs.
- Unit tests prove the seed caps (clear/el/ed/el1/cuu1/home/bel/smcup/rmcup/op/
sgr0) equal the parsed terminfo strings.
Compass (clang C inventory vs syn Rust inventory) used before/during/after; the
syn walker now also indexes inherent-impl methods so curated counterparts can
target Terminfo::tiget* and be verified.
Result: terminfo group 0 -> 18.2% (6 full). Overall 43/481 (8.9%): 10 full, 9
partial, 15 scaffold, 2 divergent, 6 deferred, 1 n/a. docs/terminfo-atlas.md
records method and non-claims (extended caps, setupterm, tparm/tputs, mvcur).1 parent 6f692ed commit 8117c4d
17 files changed
Lines changed: 1292 additions & 26 deletions
File tree
- docs-src/models
- docs
- generated
- examples
- reports/oracle
- src
- terminfo
- tests/terminfo
- tools
- oracle-runner
- source-indexer
- xtask/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
50 | 66 | | |
51 | 67 | | |
52 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
416 | 422 | | |
417 | 423 | | |
418 | 424 | | |
| |||
0 commit comments