Function punctuated_with_trailing

Source
pub(crate) fn punctuated_with_trailing<E: Peek, R>(
    cx: &mut ParseCtxt<'_>,
    sep: Token,
    end: E,
    parse: impl FnMut(&mut ParseCtxt<'_>) -> ParseResult<R>,
) -> ParseResult<(Vec<R>, bool)>
Expand description

Parses a list of zero or more items separated by a punctuation, with optional trailing punctuation. Parsing continues until the requested end token is reached. This does not consume the end token.

Returns the vector of items and a boolean indicating whether trailing punctuation was present.