Crate rustc_parse
source ·Expand description
The main parser interface.
Modules
- errors 🔒
- Meta-syntax validation logic of attributes for post-expansion.
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<Diagnostic>instead of a singleDiagnosticBuilder.
Constants
Statics
- Raw content of Fluent resource for this crate, generated by
fluent_messagesmacro, imported byrustc_driverto include all crates’ resources in one bundle.
Functions
- 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; these must be consumed via
emit,cancel, etc., otherwise a panic will occur when they are dropped. - Given a session and a
source_file, return a parser. Returns any buffered errors from lexing the initial token stream. - Creates a new parser, aborting 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
fon the tokens of the givenattr’s item. - Given a
source_file, produces a sequence of token trees. - Given a stream and the
ParseSess, produces a parser.