## Coverage Report

#### Created: 2025-09-08 21:26

next uncovered line (L), next uncovered region (R), next uncovered branch (B)

    /home/noah/src/ruchy/src/frontend/parser/types.rs

    Line
    Count
    Source
    1
    //! Type-related parsing - minimal version with only used functions
    2
    3
    use super::{ParserState, *};
    4
    5
    0
    pub fn parse_struct_literal(
    6
    0
        state: &mut ParserState,
    7
    0
        name: String,
    8
    0
        start_span: Span,
    9
    0
    ) -> Result<Expr> {
    10
    0
        state.tokens.expect(&Token::LeftBrace)?;
    11
    12
    0
        let mut fields = Vec::new();
    13
    0
        while !matches!(state.tokens.peek(), Some((Token::RightBrace, _))) {
    14
            // Parse field name
    15
    0
            let field_name = if let Some((Token::Identifier(name), _)) = state.tokens.peek() {
    16
    0
                let name = name.clone();
    17
    0
                state.tokens.advance();
    18
    0
                name
    19
            } else {
    20
    0
                bail!("Expected field name");
    21
            };
    22
    23
            // Parse colon and value
    24
    0
            state.tokens.expect(&Token::Colon)?;
    25
    0
            let value = super::parse_expr_recursive(state)?;
    26
    27
    0
            fields.push((field_name, value));
    28
    29
            // Handle comma or end of struct literal
    30
    0
            if matches!(state.tokens.peek(), Some((Token::Comma, _))) {
    31
    0
                state.tokens.advance();
    32
    0
            } else {
    33
    0
                break;
    34
            }
    35
        }
    36
    37
    0
        state.tokens.expect(&Token::RightBrace)?;
    38
    39
    0
        Ok(Expr::new(
    40
    0
            ExprKind::StructLiteral { name, fields },
    41
    0
            start_span,
    42
    0
        ))
    43
    0
    }