Crate syntax_pos [] [src]

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

The source positions and related helper functions

Note

This API is completely unstable and subject to change.

Structs

BytePos [
Experimental
]

A byte offset. Keep this small (currently 32-bits), as AST contains a lot of them.

CharPos [
Experimental
]

A character offset. Because of multibyte utf8 characters, a byte offset is not equivalent to a character offset. The CodeMap will convert BytePos values to CharPos values as necessary.

DistinctSources [
Experimental
]
ExpnId [
Experimental
]
FileLines [
Experimental
]
FileMap [
Experimental
]

A single source in the CodeMap.

FileMapAndBytePos [
Experimental
]
FileMapAndLine [
Experimental
]
LineInfo [
Experimental
]
Loc [
Experimental
]

A source code location used for error reporting

LocWithOpt [
Experimental
]

A source code location used as the result of lookup_char_pos_adj

MacroBacktrace [
Experimental
]
MalformedCodemapPositions [
Experimental
]
MultiByteChar [
Experimental
]

Identifies an offset of a multi-byte character in a FileMap

MultiSpan [
Experimental
]

A collection of spans. Spans have two orthogonal attributes:

Span [
Experimental
]

Spans represent a region of code, used for error reporting. Positions in spans are absolute positions from the beginning of the codemap, not positions relative to FileMaps. Methods on the CodeMap can be used to relate spans back to the original source. You must be careful if the span crosses more than one file - you will not be able to use many of the functions on spans in codemap and you cannot assume that the length of the span = hi - lo; there may be space in the BytePos range between files.

SpanLabel [
Experimental
]

Enums

SpanLinesError [
Experimental
]
SpanSnippetError [
Experimental
]

Constants

COMMAND_LINE_EXPN [
Experimental
]
COMMAND_LINE_SP [
Experimental
]
DUMMY_SP [
Experimental
]
NO_EXPANSION [
Experimental
]
PROC_EXPN [
Experimental
]

Statics

SPAN_DEBUG [
Experimental
]

Traits

Pos [
Experimental
]

Functions

mk_sp [
Experimental
]

Type Definitions

FileLinesResult [
Experimental
]
FileName [
Experimental
]