fn parse_record_ty(
        &mut self,
        start_token: Token<'file>,
    ) -> Result<Term<'file>, Diagnostic<FileSpan>> {
        let mut fields = Vec::new();

        self.expect_match(TokenKind::Open(DelimKind::Brace))?;

        loop {
            let docs = self.expect_doc_comments();

            if let Some(label) = self.try_identifier() {
                self.expect_match(TokenKind::Colon)?;
                let ann = self.parse_term(Prec(0))?;

                fields.push(RecordTypeField { docs, label, ann });

                if self.try_match(TokenKind::Semicolon).is_some() {
                    continue;
                } else {
                    let end_token = self.expect_match(TokenKind::Close(DelimKind::Brace))?;
                    let span = FileSpan::merge(start_token.span(), end_token.span());

                    return Ok(Term::RecordType(span, fields));
                }
            } else {
                break;
            }
        }

        let end_token = self.expect_match(TokenKind::Close(DelimKind::Brace))?;
        let span = FileSpan::merge(start_token.span(), end_token.span());

        Ok(Term::RecordType(span, fields))
    }
/// Parse the trailing part of a record type.
///
/// ```text
/// record-type         ::= "{" (record-type-field ";")* record-type-field? "}"
/// record-type-field   ::= DOC_COMMENT* IDENTIFIER ":" term(0)
/// ```
Parse the trailing part of a record type.
Parse the trailing part of a record type .
fn parse_record_ty(
        &mut self,
        start_token: Token<'file>,
    ) -> Result<Term<'file>, Diagnostic<FileSpan>> {
        let mut fields = Vec::new();
        self.expect_match(TokenKind::Open(DelimKind::Brace))?;
        loop {
            let docs = self.expect_doc_comments();
            if let Some(label) = self.try_identifier() {
                self.expect_match(TokenKind::Colon)?;
                let ann = self.parse_term(Prec(0))?;
                fields.push(RecordTypeField { docs, label, ann });
                if self.try_match(TokenKind::Semicolon).is_some() {
                    continue;
                } else {
                    let end_token = self.expect_match(TokenKind::Close(DelimKind::Brace))?;
                    let span = FileSpan::merge(start_token.span(), end_token.span());
                    return Ok(Term::RecordType(span, fields));
                }
            } else {
                break;
            }
        }
        let end_token = self.expect_match(TokenKind::Close(DelimKind::Brace))?;
        let span = FileSpan::merge(start_token.span(), end_token.span());
        Ok(Term::RecordType(span, fields))
    }
fn parse_record_ty ( & mut self , start_token : Token < ' file > , ) -> Result < Term < ' file > , Diagnostic < FileSpan > > { let mut fields = Vec :: new ( ) ; self . expect_match ( TokenKind :: Open ( DelimKind :: Brace ) ) ? ; loop { let docs = self . expect_doc_comments ( ) ; if let Some ( label ) = self . try_identifier ( ) { self . expect_match ( TokenKind :: Colon ) ? ; let ann = self . parse_term ( Prec ( 0 ) ) ? ; fields . push ( RecordTypeField { docs , label , ann } ) ; if self . try_match ( TokenKind :: Semicolon ) . is_some ( ) { continue ; } else { let end_token = self . expect_match ( TokenKind :: Close ( DelimKind :: Brace ) ) ? ; let span = FileSpan :: merge ( start_token . span ( ) , end_token . span ( ) ) ; return Ok ( Term :: RecordType ( span , fields ) ) ; } } else { break ; } } let end_token = self . expect_match ( TokenKind :: Close ( DelimKind :: Brace ) ) ? ; let span = FileSpan :: merge ( start_token . span ( ) , end_token . span ( ) ) ; Ok ( Term :: RecordType ( span , fields ) ) }
Parse the trailing part of a record type.
Parse the trailing part of a record type .
&mut self
start_token
Token<'file>
&mut self
start_token
Token<'file>