Skip to main content

parenthesized_range

Function parenthesized_range 

Source
pub fn parenthesized_range(
    expr: ExprRef<'_>,
    parent: AnyNodeRef<'_>,
    comment_ranges: &CommentRanges,
    source: &str,
) -> Option<TextRange>
Expand description

Returns the TextRange of a given expression including parentheses, if the expression is parenthesized; or None, if the expression is not parenthesized.

Prefer crate::token::parenthesized_range if you have access to crate::token::Tokens.