Function syntax::ext::tt::quoted::parse_sep_and_kleene_op [−][src]
fn parse_sep_and_kleene_op<I>(
input: &mut Peekable<I>,
span: Span,
sess: &ParseSess,
features: &Features,
attrs: &[Attribute]
) -> (Option<Token>, KleeneOp) where
I: Iterator<Item = TokenTree>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Attempt to parse a single Kleene star, possibly with a separator.
For example, in a pattern such as $(a),*
, a
is the pattern to be repeated, ,
is the
separator, and *
is the Kleene operator. This function is specifically concerned with parsing
the last two tokens of such a pattern: namely, the optional separator and the Kleene operator
itself. Note that here we are parsing the macro itself, rather than trying to match some
stream of tokens in an invocation of a macro.
This function will take some input iterator input
corresponding to span
and a parsing
session sess
. If the next one (or possibly two) tokens in input
correspond to a Kleene
operator and separator, then a tuple with (separator, KleeneOp)
is returned. Otherwise, an
error with the appropriate span is emitted to sess
and a dummy value is returned.