Expand description
Source position spans.
Structs§
- FileId
- T3.5 (R2.2): which file a
Spanbelongs to. Allocated once per file by the same “one counter, threaded from the per-project parse loop” shape T3.4 used forExprId(phase_parse/parse_sourcesinbynk-emit). Defaults toFileId::UNKNOWN— mostSpanconstruction across the workspace is either purely position-arithmetic (merge/offset, which propagate whateverfilethe input spans already carried) or a synthetic/single-file context (an LSP code action, a checker-internal zero-width span) that was never at risk of the R2.2 defect (a label rendered against the wrong file) in the first place — the defect is specifically about aSpancompared or rendered across files, and those all originate at the lexer, the one placeFileId::UNKNOWNis never used. - Line
Index - A per-snapshot table of line-start byte offsets, built once and shared by every position lookup over that snapshot (#732).
- Span
- A byte range in the source. Half-open:
[start, end).
Functions§
- line_
col - 1-indexed (line, column) of a byte offset in
source. Columns count characters, not bytes. Lives in the syntax leaf so every layer that maps a span to a position — the emitter’s assertion locations,bynkc’sshortrendering, and (slice 6)bynk-render— shares one implementation.