Skip to main content

Crate rustc_parse

Crate rustc_parse 

Source
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ยง

MACRO_ARGUMENTS
UNICODE_VERSION

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 f on the tokens of the given attrโ€™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