rustc_expand::mbe::transcribe

Function lookup_cur_matched

Source
fn lookup_cur_matched<'a>(
    ident: MacroRulesNormalizedIdent,
    interpolations: &'a FxHashMap<MacroRulesNormalizedIdent, NamedMatch>,
    repeats: &[(usize, usize)],
) -> Option<&'a NamedMatch>
Expand description

Lookup the meta-var named ident and return the matched token tree from the invocation using the set of matches interpolations.

See the definition of repeats in the transcribe function. repeats is used to descend into the right place in nested matchers. If we attempt to descend too far, the macro writer has made a mistake, and we return None.