Commit 0ea359b
feat(selfhost): Step 3 spans — lexer tier-1 (line/col) + tier-2 (length) complete
The rss tokenizer already tracked per-char line/col (used by statement_end); added
a `len` field to Tok (= the consumed source span j-i, matching the Rust lexer's
index-start) and taught lexer.rss to emit the real `<line>:<col>:<len>` prefix
instead of the `0:0:0` placeholder.
Result: lexer_parity_corpus is byte-exact at ALL THREE tiers over 576 files —
tier 0 (kind+payload), tier 1 (+line/col), tier 2 (+length), token-mismatches 0
each. The lexer span ladder is fully closed; string/char/multiline/interp
delimiter spans and the max(1) cases all match. Tok.len is additive (only lexer.rss
reads it); parser/checker/astdump parity unaffected (all samples green).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent e8141f9 commit 0ea359b
2 files changed
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
562 | | - | |
| 563 | + | |
563 | 564 | | |
564 | 565 | | |
565 | 566 | | |
| |||
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
579 | | - | |
| 580 | + | |
580 | 581 | | |
581 | 582 | | |
582 | 583 | | |
| |||
0 commit comments