Module syntax::codemap [] [src]

🔬 This is a nightly-only experimental API. (rustc_private)

The CodeMap 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 CodeMap and are represented by FileMaps. Byte positions are stored in spans and used pervasively in the compiler. They are absolute positions within the CodeMap, which upon request can be converted to line and column information, source code snippets, etc.

Reexports

pub use self::ExpnFormat::*;
pub use syntax_pos::*;

Structs

CodeMap [
Experimental
]
ExpnInfo [
Experimental
]

Extra information for tracking spans of macro and syntax sugar expansion

NameAndSpan [
Experimental
]
RealFileLoader [
Experimental
]

A FileLoader that uses std::fs to load real files.

Spanned [
Experimental
]

Enums

ExpnFormat [
Experimental
]

The source of expansion.

Traits

FileLoader [
Experimental
]

An abstraction over the fs operations used by the Parser.

Functions

dummy_spanned [
Experimental
]
original_sp [
Experimental
]

Return 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 the expn_info chain.

respan [
Experimental
]
spanned [
Experimental
]