The source positions and related helper functions.
This API is completely unstable and subject to change.
Machinery for hygienic macros, inspired by the
An "interner" is a data structure that associates values with usize tags and allows bidirectional lookup; i.e., given a value, one can easily find the type, and vice versa.
A byte offset. Keep this small (currently 32-bits), as AST contains a lot of them.
A character offset. Because of multibyte UTF-8 characters, a byte offset
is not equivalent to a character offset. The
Range inside of a
A source code location used for error reporting.
Identifies an offset of a multi-byte character in a
A collection of spans. Spans have two orthogonal attributes:
Identifies an offset of a character that was normalized away from
A single source in the
The hash of the on-disk source file used for debug info.
A compressed span.
Spans represent a region of code, used for error reporting. Positions in spans
are absolute positions from the beginning of the source_map, not positions
The state of the lazy external source loading mechanism of a
Differentiates between real files and common virtual files.
Identifies an offset of a non-narrow character in a
Dummy span, both position and length are zero, syntax context is zero as well.
Requirements for a
Calls the provided closure, using the provided