as_expr_macro_token_tree

Function as_expr_macro_token_tree 

Source
pub fn as_expr_macro_token_tree(
    token_tree: impl DoubleEndedIterator<Item = TokenTree>,
    file_id: FileId,
    db: &dyn SyntaxGroup,
) -> Option<Expr>
Expand description

Takes a token tree syntax node, which is assumed to be parsable as an expression (it assumes that the prefix is an expr, not the whole iterator), tries to parse it as such, and returns the result. The token tree iterator is consumed entirely. The resulting expression’s offset corresponds to the offset of the first token in the provided token tree.