Skip to main content

Module metavar_expr

Module metavar_expr 

Source

Re-exportsยง

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; ๐Ÿ”’

Enumsยง

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)}).

Constantsยง

UNSUPPORTED_CONCAT_ELEM_ERR ๐Ÿ”’

Functionsยง

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 ๐Ÿ”’