Struct syntax_pos::FileMap [] [src]

pub struct FileMap {
    pub name: FileName,
    pub abs_path: Option<FileName>,
    pub src: Option<Rc<String>>,
    pub start_pos: BytePos,
    pub end_pos: BytePos,
    pub lines: RefCell<Vec<BytePos>>,
    pub multibyte_chars: RefCell<Vec<MultiByteChar>>,
}
🔬 This is a nightly-only experimental API. (rustc_private)

A single source in the CodeMap.

Fields

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

The name of the file that the source came from, source that doesn't originate from files has names between angle brackets by convention, e.g. <anon>

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

The absolute path of the file that the source came from.

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

The complete source code

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

The start position of this source in the CodeMap

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

The end position of this source in the CodeMap

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

Locations of lines beginnings in the source code

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

Locations of multi-byte characters in the source code

Methods

impl FileMap
[src]

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

EFFECT: register a start-of-line offset in the table of line-beginnings. UNCHECKED INVARIANT: these offsets must be added in the right order and must be in the right places; there is shared knowledge about what ends a line between this file and parse.rs WARNING: pos param here is the offset relative to start of CodeMap, and CodeMap will append a newline when adding a filemap without a newline at the end, so the safe way to call this is with value calculated as filemap.start_pos + newline_offset_relative_to_the_start_of_filemap.

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

get a line from the list of pre-computed line-beginnings. line-number here is 0-based.

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

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

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

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

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

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

Find the line containing the given position. The return value is the index into the lines array of this FileMap, not the 1-based line number. If the filemap is empty or the position is located before the first line, None is returned.

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

Trait Implementations

impl Encodable for FileMap
[src]

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

deprecated in favor of rustc-serialize on crates.io

impl Decodable for FileMap
[src]

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

deprecated in favor of rustc-serialize on crates.io

impl Debug for FileMap
[src]

Formats the value using the given formatter.