Crate rustc_parse[−][src]

Expand description

The main parser interface.

Modules

Token Streams

Meta-syntax validation logic of attributes for post-expansion.

Unicode string slices.

Macros

If the next tokens are ill-formed $ty:: recover them as <$ty>::.

Like maybe_whole_expr, but for things other than expressions.

A variant of ‘panictry!’ that works on a Vec instead of a single DiagnosticBuilder.

Structs

A AttrAnnotatedTokenStream is similar to a TokenStream, but with extra information about the tokens for attribute targets. This is used during expansion to perform early cfg-expansion, and to process attributes during proc-macro invocations.

Metadata associated with an item.

Stores the tokens for an attribute target, along with its attributes.

Used as a return value to signify a fatal error occurred. (It is also used as the argument to panic at the moment, but that will eventually not be true.)

A lazy version of TokenStream, which defers creation of an actual TokenStream until it is needed. Box is here only to reduce the structure size.

A spanned compile-time attribute item.

Info about a parsing session.

A single source in the SourceMap.

A compressed span.

A TokenStream is an abstract sequence of tokens, organized into TokenTrees.

A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.

A slice of a path (akin to str).

Enums

Indicates the confidence in the correctness of a suggestion.

Like TokenTree, but for AttrAnnotatedTokenStream

Differentiates between real files and common virtual files.

For interpolation during macro expansion.

Constants

Traits

An AstLike represents an AST node (or some wrapper around and AST node) which stores some combination of attributes and tokens.

Functions

Given a session and a path and an optional span (for error reporting), adds the path to the session’s source_map and returns the new source_file.

Given a source file, produces a sequence of token trees. Returns any buffered errors from parsing the token stream.

Creates a new parser from a source string. Returns any buffered errors from lexing the initial token stream.

Given a source_file and config, return a parser. Returns any buffered errors from lexing the initial token stream.

Creates a new parser, handling errors as appropriate if the file doesn’t exist. If a span is given, that is used on an error as the source of the problem.

Creates a new parser from a source string.

Runs the given subparser f on the tokens of the given attr’s item.

Given a source_file and config, returns a parser.

Given a source_file, produces a sequence of token trees.

Given a stream and the ParseSess, produces a parser.

Given a session and a path and an optional span (for error reporting), add the path to the session’s source_map and return the new source_file or error when a file can’t be read.

Type Definitions