Struct cpp_synmap::SourceMap [] [src]

pub struct SourceMap { /* fields omitted */ }

The SourceMap is the primary entry point for synmap. It maintains a mapping between Span objects and the original source files they were parsed from.

Methods

impl SourceMap
[src]

[src]

Create a new SourceMap object with no files inside of it.

[src]

Read and parse the passed-in file path as a crate root, recursively parsing each of the submodules. Produces a syn Crate object with all submodules inlined.

Span objects inside the resulting crate object are SourceMap relative, and should be interpreted by passing to the other methods on this type, such as locinfo, source_text, or filename.

[src]

Get the filename which contains the given span.

Fails if the span is invalid or spans multiple source files.

[src]

Get the source text for the passed-in span.

Fails if the span is invalid or spans multiple source files.

[src]

Get a LocInfo object for the passed-in span, containing line, column, and file name information for the beginning and end of the span. The path field in the returned LocInfo struct will be a reference to a canonical path.

Fails if the span is invalid or spans multiple source files.

Trait Implementations

impl Debug for SourceMap
[src]

[src]

Formats the value using the given formatter.