Expand description
Types for tracking pieces of source code within a crate.
The SourceMap
tracks all the source code used within a single crate, mapping
from integer byte positions to the original source code location. Each bit
of source parsed during crate parsing (typically files, in-memory strings,
or various bits of macro expansion) cover a continuous range of bytes in the
SourceMap
and are represented by SourceFile
s. Byte positions are stored in
Span
and used pervasively in the compiler. They are absolute positions
within the SourceMap
, which upon request can be converted to line and column
information, source code snippets, etc.
Modules§
Structs§
- File
Path Mapping - Real
File Loader - A FileLoader that uses std::fs to load real files.
- Source
Map - Source
MapFiles 🔒 - Source
MapInputs - Used to construct a
SourceMap
withSourceMap::with_inputs
. - Spanned
Traits§
- File
Loader - An abstraction over the fs operations used by the Parser.
Functions§
- dummy_
spanned - get_
source_ map - original_
sp - Returns the span itself if it doesn’t come from a macro expansion,
otherwise return the call site span up to the
enclosing_sp
by following theexpn_data
chain. - respan