fn parse_parenthesized(
    open_paren_token: Token<TokenKind>,
    token_stream: &mut TokenStream<Lexer>,
    diagnostics: &mut Diagnostics,
) -> Result<Expr, ParseError> {
    token_stream.next(diagnostics);
    let mut output_expr =
        parse_with_end(CloseParen, token_stream, diagnostics)?;
    output_expr.span = output_expr.span.join(&open_paren_token.span);

    match token_stream.current() {
        Ok(token) if token.kind == CloseParen => {
            output_expr.span = output_expr.span.join(&token.span);
            token_stream.next(diagnostics);
        },
        _ => {
            let error = UnmatchedOpenParen { span: open_paren_token.span };
            diagnostics.raise(error);
        },
    }

    Ok(output_expr)
}
/// Parses an expression surrounded by parenthesis.
Parses an expression surrounded by parenthesis.
Parses an expression surrounded by parenthesis .
fn parse_parenthesized(
    open_paren_token: Token<TokenKind>,
    token_stream: &mut TokenStream<Lexer>,
    diagnostics: &mut Diagnostics,
) -> Result<Expr, ParseError> {
    token_stream.next(diagnostics);
    let mut output_expr =
        parse_with_end(CloseParen, token_stream, diagnostics)?;
    output_expr.span = output_expr.span.join(&open_paren_token.span);
    match token_stream.current() {
        Ok(token) if token.kind == CloseParen => {
            output_expr.span = output_expr.span.join(&token.span);
            token_stream.next(diagnostics);
        },
        _ => {
            let error = UnmatchedOpenParen { span: open_paren_token.span };
            diagnostics.raise(error);
        },
    }
    Ok(output_expr)
}
fn parse_parenthesized ( open_paren_token : Token < TokenKind > , token_stream : & mut TokenStream < Lexer > , diagnostics : & mut Diagnostics , ) -> Result < Expr , ParseError > { token_stream . next ( diagnostics ) ; let mut output_expr = parse_with_end ( CloseParen , token_stream , diagnostics ) ? ; output_expr . span = output_expr . span . join ( & open_paren_token . span ) ; match token_stream . current ( ) { Ok ( token ) if token . kind == CloseParen => { output_expr . span = output_expr . span . join ( & token . span ) ; token_stream . next ( diagnostics ) ; } , _ => { let error = UnmatchedOpenParen { span : open_paren_token . span } ; diagnostics . raise ( error ) ; } , } Ok ( output_expr ) }
Parses an expression surrounded by parenthesis.
Parses an expression surrounded by parenthesis .
open_paren_token
Token<TokenKind>
token_stream
&mut TokenStream<Lexer>
diagnostics
&mut Diagnostics
open_paren_token
Token<TokenKind>
token_stream
&mut TokenStream<Lexer>
diagnostics
&mut Diagnostics