Expand description
The main parser interface.
Re-exportsยง
pub(crate) use parser::Parser;๐pub(crate) use crate::lexer::StripTokens;๐pub(crate) use Path;๐pub(crate) use PathBuf;๐pub(crate) use std::str::Utf8Error;๐pub(crate) use std::sync::Arc;๐pub(crate) use rustc_ast as ast;๐pub(crate) use rustc_ast::token;๐pub(crate) use DelimSpacing;๐pub(crate) use DelimSpan;๐pub(crate) use Spacing;๐pub(crate) use TokenStream;๐pub(crate) use TokenTree;๐pub(crate) use rustc_ast_pretty::pprust;๐pub(crate) use Diag;๐pub(crate) use FatalError;๐pub(crate) use PResult;๐pub(crate) use pluralize;๐pub(crate) use rustc_session::parse::ParseSess;๐pub(crate) use rustc_span::edit_distance::find_best_match_for_name;๐pub(crate) use rustc_span::source_map::SourceMap;๐pub(crate) use FileName;๐pub(crate) use SourceFile;๐pub(crate) use Span;๐pub(crate) use Symbol;๐
Modulesยง
- diagnostics ๐
- lexer
- parser
Macrosยง
- exp
- maybe_
recover_ from_ interpolated_ ty_ qpath - If the next tokens are ill-formed
$ty::recover them as<$ty>::.
Constantsยง
Functionsยง
- fake_
token_ stream_ for_ crate - fake_
token_ ๐stream_ for_ file_ mod - fake_
token_ stream_ for_ foreign_ item - fake_
token_ stream_ for_ item - lex_
token_ ๐trees_ for_ span - new_
parser_ from_ file - Creates a new parser from a filename. On failure, the errors must be consumed via
unwrap_or_emit_fatal,emit,cancel, etc., otherwise a panic will occur when they are dropped. - new_
parser_ ๐from_ source_ file - Given a session and a
source_file, return a parser. Returns any buffered errors from lexing the initial token stream. - new_
parser_ from_ source_ str - Creates a new parser from a source string.
- parse_
in - Runs the given subparser
fon the tokens of the givenattrโs item. - source_
file_ ๐to_ stream - Given a source file, produces a sequence of token trees.
- source_
str_ to_ stream - Given a source string, produces a sequence of token trees.
- unwrap_
or_ emit_ fatal - utf8_
error