Expand description
Source files, positions and ranges.
Every file the compiler reads is stored once in a SourceMap and identified by a FileId.
Positions inside a file are byte offsets (Span). Line and column numbers are computed only
when a diagnostic is shown; columns count Unicode scalar values (spec chapter 1, section 1).
Structs§
- FileId
- Identifies a file inside a
SourceMap. - LineCol
- A one-based line and column. The column counts Unicode scalar values.
- Source
File - One source file: its display name and its text.
- Source
Map - All source files of one compilation.
- Span
- A range of bytes in one file.
startis inclusive,endis exclusive.
Constants§
- MAX_
FILE_ SIZE - The largest file the compiler accepts, in bytes. Offsets are stored as
u32.