Skip to main contentModule metavar_expr
Source use rustc_ast::token; ๐ use rustc_ast::token::Delimiter; ๐ use rustc_ast::token::IdentKind; ๐ use rustc_ast::token::Lit; ๐ use rustc_ast::token::Token; ๐ use rustc_ast::token::TokenKind; ๐ use rustc_ast::tokenstream::TokenStream; ๐ use rustc_ast::tokenstream::TokenStreamIter; ๐ use rustc_ast::tokenstream::TokenTree; ๐ use rustc_ast::LitIntType; ๐ use rustc_ast::LitKind; ๐ use rustc_ast_pretty::pprust; ๐ use rustc_errors::Applicability; ๐ use rustc_errors::PResult; ๐ use rustc_macros::Decodable; ๐ use rustc_macros::Encodable; ๐ use rustc_session::parse::ParseSess; ๐ use rustc_span::Ident; ๐ use rustc_span::Span; ๐ use rustc_span::Symbol; ๐ use rustc_span::sym; ๐ use crate::diagnostics; ๐
- MetaVarExpr ๐
- A meta-variable expression, for expansions based on properties of meta-variables.
- MetaVarExprConcatElem ๐
- Indicates what is placed in a
concat parameter. For example, literals
(${concat("foo", "bar")}) or adhoc identifiers (${concat(foo, bar)}).
- UNSUPPORTED_CONCAT_ELEM_ERR ๐
- check_trailing_tokens ๐
- Checks if there are any remaining tokens (for example,
${ignore($valid, extra)}) and create
a diag with the correct arg count if so. - eat_dollar ๐
- Expects that the next item is a dollar sign.
- iter_span ๐
- Returns a span encompassing all tokens in the iterator if there is at least one item.
- parse_concat ๐
- Parse a meta-variable
concat expression: concat($metavar, ident, ...). - parse_count ๐
- Parse a meta-variable
count expression: count(ident[, depth]) - parse_depth ๐
- Parses the depth used by index(depth) and len(depth).
- parse_ident ๐
- Parses an generic ident
- parse_ident_from_token ๐
- parse_token ๐
- try_eat_comma ๐
- Tries to move the iterator forward returning
true if there is a comma. If not, then the
iterator is not modified and the result is false. - try_eat_dollar ๐
- Tries to move the iterator forward returning
true if there is a dollar sign. If not, then the
iterator is not modified and the result is false. - validate_ident_kind ๐