Skip to main content

Module source

Module source 

Source
Expand description

Source files and the mapping from byte offsets back to line and column.

Everything downstream of the lexer works in byte offsets. Line and column are computed only when a diagnostic is rendered, so the common path never pays for them.

Structsยง

FileId
Handle to a file inside a SourceMap.
Location
A one based line and column pair, suitable for showing to a person.
SourceFile
A single source file, with a precomputed index of where each line starts.
SourceMap
Owns every file the compiler has seen.