[][src]Crate rustc_parse

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The main parser interface.

Modules

lexerInternal
parserInternal
validate_attrInternal

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

Macros

maybe_recover_from_interpolated_ty_qpathInternal

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

maybe_wholeInternal

Like maybe_whole_expr, but for things other than expressions.

Constants

MACRO_ARGUMENTSInternal

Functions

file_to_source_fileInternal

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.

maybe_file_to_streamInternal

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

maybe_new_parser_from_fileInternal

Creates a new parser, returning buffered diagnostics if the file doesn't exist, or from lexing the initial token stream.

maybe_new_parser_from_source_strInternal

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

maybe_source_file_to_parserInternal

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

new_parser_from_fileInternal

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 as the source of the problem.

new_parser_from_source_strInternal

Creates a new parser from a source string.

new_parser_from_ttsInternal
nt_to_tokenstreamInternal
parse_crate_attrs_from_fileInternal
parse_crate_attrs_from_source_strInternal
parse_crate_from_fileInternal
parse_crate_from_source_strInternal
parse_inInternal

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

parse_stream_from_source_strInternal
prepend_attrsInternal
source_file_to_parserInternal

Given a source_file and config, returns a parser.

source_file_to_streamInternal

Given a source_file, produces a sequence of token trees.

stream_to_parserInternal

Given a stream and the ParseSess, produces a parser.

try_file_to_source_fileInternal

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.