[][src]Module syntax::ext::tt::macro_rules

⚙️ 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.

Structs

FirstSetsInternal
MacroRulesMacroExpanderInternal
ParserAnyMacroInternal
TokenSetInternal

Enums

IsInFollowInternal

Constants

VALID_FRAGMENT_NAMES_MSGInternal

Functions

check_lhs_duplicate_matcher_bindingsInternal

Check that the LHS contains no duplicate matcher bindings. e.g. $a:expr, $a:expr would be illegal, since it would be ambiguous which $a to use if we ever needed to.

check_lhs_no_empty_seqInternal

Checks that the lhs contains no repetition which could match an empty token tree, because then the matcher would hang indefinitely.

check_lhs_nt_followsInternal
check_matcherInternal
check_matcher_coreInternal
check_rhsInternal
compileInternal

Converts a macro_rules! invocation into a syntax extension.

frag_can_be_followed_by_anyInternal

Returns true if a fragment of type frag can be followed by any sort of token. We use this (among other things) as a useful approximation for when frag can be followed by a repetition like $(...)* or $(...)+. In general, these can be a bit tricky to reason about, so we adopt a conservative position that says that any fragment specifier which consumes at most one token tree can be followed by a fragment specifier (indeed, these fragments can be followed by ANYTHING without fear of future compatibility hazards).

generic_extensionInternal

Given lhses and rhses, this is the new macro we create

has_legal_fragment_specifierInternal
is_in_followInternal

Returns true if frag can legally be followed by the token tok. For fragments that can consume an unbounded number of tokens, tok must be within a well-defined follow set. This is intended to guarantee future compatibility: for example, without this rule, if we expanded expr to include a new binary operator, we might break macros that were relying on that binary operator as a separator.

is_legal_fragment_specifierInternal
quoted_tt_to_stringInternal
token_can_be_followed_by_anyInternal
trace_macros_noteInternal