/// Parse the trailing part of a let expression.
///
/// ```text
/// let-expr ::= item+ "in" term(0)
/// ```
Parse the trailing part of a let expression.
Parse the trailing part of a let expression .
fn parse_let_expr(
        &mut self,
        start_token: Token<'file>,
    ) -> Result<Term<'file>, Diagnostic<FileSpan>> {
        let mut items = Vec::new();
        while self.is_peek_match(ItemStart) {
            items.push(self.parse_item()?);
        }
        if items.is_empty() {
            return Err(
                Diagnostic::new_error("expected at least one item").with_label(
                    Label::new_primary(start_token.span())
                        .with_message("at least one item was expected after this keyword"),
                ),
            );
        }
        self.expect_match(Keyword("in"))?;
        let body_term = self.parse_term(Prec(0))?;
        let span = FileSpan::merge(start_token.span(), body_term.span());
        Ok(Term::Let(span, items, Box::new(body_term)))
    }
fn parse_let_expr ( & mut self , start_token : Token < ' file > , ) -> Result < Term < ' file > , Diagnostic < FileSpan > > { let mut items = Vec :: new ( ) ; while self . is_peek_match ( ItemStart ) { items . push ( self . parse_item ( ) ? ) ; } if items . is_empty ( ) { return Err ( Diagnostic :: new_error ( " " ) . with_label ( Label :: new_primary ( start_token . span ( ) ) . with_message ( " " ) , ) , ) ; } self . expect_match ( Keyword ( " " ) ) ? ; let body_term = self . parse_term ( Prec ( 0 ) ) ? ; let span = FileSpan :: merge ( start_token . span ( ) , body_term . span ( ) ) ; Ok ( Term :: Let ( span , items , Box :: new ( body_term ) ) ) }
Parse the trailing part of a let expression.
Parse the trailing part of a let expression .
&mut self
start_token
Token<'file>