Struct syntax::codemap::CodeMap [] [src]

pub struct CodeMap { /* fields omitted */ }

Methods

impl CodeMap
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Creates a new filemap without setting its line information. If you don't intend to set the line information yourself, you should use new_filemap_and_lines.

[src]

Creates a new filemap and sets its line information.

[src]

Allocates a new FileMap representing a source file from an external crate. The source code of such an "imported filemap" is not available, but we still know enough to generate accurate debuginfo location information for things inlined from other crates.

[src]

[src]

[src]

Lookup source information about a BytePos

[src]

[src]

[src]

Returns Some(span), a union of the lhs and rhs span. The lhs must precede the rhs. If there are gaps between lhs and rhs, the resulting union will cross these gaps. For this to work, the spans have to be:

  • the ctxt of both spans much match
  • the lhs span needs to end on the same line the rhs span begins
  • the lhs span must start at or before the rhs span

[src]

[src]

[src]

[src]

[src]

[src]

Return the source snippet as String corresponding to the given Span

[src]

Return the source snippet as String before the given Span

[src]

Given a Span, try to get a shorter span ending before the first occurrence of c char

[src]

Extend the given Span to just after the previous occurrence of c. Return the same span if no character could be found or if an error occurred while retrieving the code snippet.

[src]

Extend the given Span to just after the previous occurrence of pat. Return the same span if no character could be found or if an error occurred while retrieving the code snippet.

[src]

Given a Span, get a new Span covering the first token and all its trailing whitespace or the original Span.

If sp points to "let mut x", then a span pointing at "let " will be returned.

[src]

Given a Span, get a new Span covering the first token without its trailing whitespace or the original Span in case of error.

If sp points to "let mut x", then a span pointing at "let" will be returned.

[src]

Given a Span, try to get a shorter span ending just after the first occurrence of char c.

[src]

[src]

Returns a new span representing just the end-point of this span

[src]

Returns a new span representing the next character after the end-point of this span

[src]

[src]

For a global BytePos compute the local offset within the containing FileMap

[src]

Converts an absolute BytePos to a CharPos relative to the filemap.

[src]

[src]

Trait Implementations

impl CodeMapper for CodeMap
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Auto Trait Implementations

impl !Send for CodeMap

impl !Sync for CodeMap