parse_tree in rustc_expand::mbe::quoted - Rust
Description: Takes a `tokenstream::TokenTree` and returns a `self::TokenTree`. Specifically, this takes a generic `TokenTree`, such as is used in the rest of the compiler, and returns a `TokenTree` for use in parsing a macro.

Skip to main content

## parse_tree

# Function parse_tree

Source

    fn parse_tree<'a>(
        tree: &'a TokenTree,
        outer_iter: &mut TokenStreamIter<'a>,
        part: RulePart,
        sess: &Session,
        node_id: NodeId,
        features: &Features,
        edition: Edition,
    ) -> TokenTree

Expand description

Takes a `tokenstream::TokenTree` and returns a `self::TokenTree`. Specifically, this takes a generic `TokenTree`, such as is used in the rest of the compiler, and returns a `TokenTree` for use in parsing a macro.

Converting the given tree may involve reading more tokens.

## §Parameters

- `tree`: the tree we wish to convert.
- `outer_iter`: an iterator over trees. We may need to read more tokens from it in order to finish converting `tree`
- `part`: same as parse.
- `sess`: the parsing session. Any errors will be emitted to this session.
- `features`: language features so we can do feature gating.