pub(super) fn parse_block_tail(
        &mut self,
        lo: Span,
        s: BlockCheckMode
    ) -> PResult<'a, P<Block>> {
        let mut stmts = vec![];
        while !self.eat(&token::CloseDelim(token::Brace)) {
            if self.token == token::Eof {
                break;
            }
            let stmt = match self.parse_full_stmt(false) {
                Err(mut err) => {
                    self.maybe_annotate_with_ascription(&mut err, false);
                    err.emit();
                    self.recover_stmt_(SemiColonMode::Ignore, BlockMode::Ignore);
                    Some(self.mk_stmt(
                        self.token.span,
                        StmtKind::Expr(self.mk_expr_err(self.token.span)),
                    ))
                }
                Ok(stmt) => stmt,
            };
            if let Some(stmt) = stmt {
                stmts.push(stmt);
            } else {
                // Found only `;` or `}`.
                continue;
            };
        }
        Ok(P(ast::Block {
            stmts,
            id: DUMMY_NODE_ID,
            rules: s,
            span: lo.to(self.prev_span),
        }))
    }
/// Parses the rest of a block expression or function body.
/// Precondition: already parsed the '{'.
Parses the rest of a block expression or function body.
Precondition: already parsed the '{'.
Parses the rest of a block expression or function body . Precondition : already parsed the ' { ' .
pub(super) fn parse_block_tail(
        &mut self,
        lo: Span,
        s: BlockCheckMode
    ) -> PResult<'a, P<Block>> {
        let mut stmts = vec![];
        while !self.eat(&token::CloseDelim(token::Brace)) {
            if self.token == token::Eof {
                break;
            }
            let stmt = match self.parse_full_stmt(false) {
                Err(mut err) => {
                    self.maybe_annotate_with_ascription(&mut err, false);
                    err.emit();
                    self.recover_stmt_(SemiColonMode::Ignore, BlockMode::Ignore);
                    Some(self.mk_stmt(
                        self.token.span,
                        StmtKind::Expr(self.mk_expr_err(self.token.span)),
                    ))
                }
                Ok(stmt) => stmt,
            };
            if let Some(stmt) = stmt {
                stmts.push(stmt);
            } else {
                // Found only `;` or `}`.
                continue;
            };
        }
        Ok(P(ast::Block {
            stmts,
            id: DUMMY_NODE_ID,
            rules: s,
            span: lo.to(self.prev_span),
        }))
    }
pub ( super ) fn parse_block_tail ( & mut self , lo : Span , s : BlockCheckMode ) -> PResult < ' a , P < Block > > { let mut stmts = vec ! [ ] ; while ! self . eat ( & token :: CloseDelim ( token :: Brace ) ) { if self . token == token :: Eof { break ; } let stmt = match self . parse_full_stmt ( false ) { Err ( mut err ) => { self . maybe_annotate_with_ascription ( & mut err , false ) ; err . emit ( ) ; self . recover_stmt_ ( SemiColonMode :: Ignore , BlockMode :: Ignore ) ; Some ( self . mk_stmt ( self . token . span , StmtKind :: Expr ( self . mk_expr_err ( self . token . span ) ) , ) ) } Ok ( stmt ) => stmt , } ; if let Some ( stmt ) = stmt { stmts . push ( stmt ) ; } else { // Found only `;` or `}`. continue ; } ; } Ok ( P ( ast :: Block { stmts , id : DUMMY_NODE_ID , rules : s , span : lo . to ( self . prev_span ) , } ) ) }
Parses the rest of a block expression or function body.
Parses the rest of a block expression or function body .
&mut self
lo
Span
s
BlockCheckMode