Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/tsv_lang/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All language crates (tsv_ts, tsv_css, tsv_svelte) depend on tsv_lang. It provide
Each module's visibility (in parens) reflects `pub use`-only modules (private) vs directly-imported modules (`pub mod`, used as `tsv_lang::doc::{...}` etc.).

- `span` (`span.rs`, private) — `Span { start: u32, end: u32 }` — compact source positions
- `location` (`location.rs`, private) — `LocationTracker` (line/column via binary search on line starts, fronted by a 1-entry line-range cache that turns the sequential-emission common case into an O(1) range check), `ByteToCharMap` (byte → UTF-16 code-unit offsets; `identity()` for byte-space passthrough), and `LocationMapper` (tracker + map bundle the AST-conversion layers thread — with a real map it emits final char-space positions during conversion, fusing out the post-conversion translation walk; with the identity map it is exact byte-space passthrough). The `no-locations` emission path skips the line-start scan entirely — it builds a line-data-free tracker via `LocationTracker::new_map_only` (stub `line_starts`, byte→UTF-16 map only) and emits `start`/`end` offsets with no line/column
- `location` (`location.rs`, private) — `LocationTracker` (line/column via binary search on line starts, fronted by a 1-entry line-range cache that turns the sequential-emission common case into an O(1) range check), `ByteToCharMap` (byte → UTF-16 code-unit offsets, stored as a dense `byte − utf16` **delta** table narrowed to `u8` unless the source's multibyte characters are dense enough to outgrow it — lookup stays one O(1) load, `pos = byte − delta[byte]`; `identity()` for byte-space passthrough, and for an ASCII-only source, which carries no table at all), and `LocationMapper` (tracker + map bundle the AST-conversion layers thread — with a real map it emits final char-space positions during conversion, fusing out the post-conversion translation walk; with the identity map it is exact byte-space passthrough). The `no-locations` emission path skips the line-start scan entirely — it builds a line-data-free tracker via `LocationTracker::new_map_only` (stub `line_starts`, byte→UTF-16 map only) and emits `start`/`end` offsets with no line/column
- `error` (`error.rs`, private) — `ParseError` with context extraction and caret formatting
- `config` (`config.rs`, private) — `PRINT_WIDTH` / `TAB_WIDTH` / `INDENT` consts + `EmbedContext` / `LayoutMode` (no runtime config)
- `doc` (`doc/*.rs`, pub) — Document builder — arena-based Prettier-compatible IR
Expand Down
Loading