fn ops_is_prefix(
psess: &ParseSess,
node_id: NodeId,
span: Span,
name: MacroRulesNormalizedIdent,
binder_ops: &[KleeneToken],
occurrence_ops: &[KleeneToken],
)Expand description
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:
psessis used to emit diagnostics and lintsnode_idis used to emit lintsspanis the span of the meta-variable being checknameis the name of the meta-variable being checkbinder_opsis the stack of Kleene operators for the binderoccurrence_opsis the stack of Kleene operators for the occurrence