[−][src]Function rustc_expand::mbe::macro_check::ops_is_prefix

pub(in mbe::macro_check) fn ops_is_prefix(
    sess: &ParseSess,
    node_id: NodeId,
    span: Span,
    name: MacroRulesNormalizedIdent,
    binder_ops: &[KleeneToken],
    occurrence_ops: &[KleeneToken]
)

Returns whether binder_ops is a prefix of occurrence_ops.

The stack of Kleene operators of a meta-variable occurrence just needs to have the stack of Kleene operators of its binder as a prefix.

Consider $i in the following example:

( $( $i:ident = $($j:ident),+ );* ) => { $($( $i += $j; )+)* }

It occurs under the Kleene stack ["", "+"] and is bound under [""] only.

Arguments: