pub fn parse_full_stmt(&mut self, macro_legacy_warnings: bool) -> PResult<'a, Option<Stmt>> {
        // Skip looking for a trailing semicolon when we have an interpolated statement.
        maybe_whole!(self, NtStmt, |x| Some(x));

        let mut stmt = match self.parse_stmt_without_recovery(macro_legacy_warnings)? {
            Some(stmt) => stmt,
            None => return Ok(None),
        };

        let mut eat_semi = true;
        match stmt.kind {
            StmtKind::Expr(ref expr) if self.token != token::Eof => {
                // expression without semicolon
                if classify::expr_requires_semi_to_be_stmt(expr) {
                    // Just check for errors and recover; do not eat semicolon yet.
                    if let Err(mut e) =
                        self.expect_one_of(&[], &[token::Semi, token::CloseDelim(token::Brace)])
                    {
                        e.emit();
                        self.recover_stmt();
                        // Don't complain about type errors in body tail after parse error (#57383).
                        let sp = expr.span.to(self.prev_span);
                        stmt.kind = StmtKind::Expr(self.mk_expr_err(sp));
                    }
                }
            }
            StmtKind::Local(..) => {
                // We used to incorrectly allow a macro-expanded let statement to lack a semicolon.
                if macro_legacy_warnings && self.token != token::Semi {
                    self.warn_missing_semicolon();
                } else {
                    self.expect_semi()?;
                    eat_semi = false;
                }
            }
            _ => {}
        }

        if eat_semi && self.eat(&token::Semi) {
            stmt = stmt.add_trailing_semicolon();
        }
        stmt.span = stmt.span.to(self.prev_span);
        Ok(Some(stmt))
    }
/// Parses a statement, including the trailing semicolon.
Parses a statement, including the trailing semicolon.
Parses a statement including the trailing semicolon .
pub fn parse_full_stmt(&mut self, macro_legacy_warnings: bool) -> PResult<'a, Option<Stmt>> {
        // Skip looking for a trailing semicolon when we have an interpolated statement.
        maybe_whole!(self, NtStmt, |x| Some(x));
        let mut stmt = match self.parse_stmt_without_recovery(macro_legacy_warnings)? {
            Some(stmt) => stmt,
            None => return Ok(None),
        };
        let mut eat_semi = true;
        match stmt.kind {
            StmtKind::Expr(ref expr) if self.token != token::Eof => {
                // expression without semicolon
                if classify::expr_requires_semi_to_be_stmt(expr) {
                    // Just check for errors and recover; do not eat semicolon yet.
                    if let Err(mut e) =
                        self.expect_one_of(&[], &[token::Semi, token::CloseDelim(token::Brace)])
                    {
                        e.emit();
                        self.recover_stmt();
                        // Don't complain about type errors in body tail after parse error (#57383).
                        let sp = expr.span.to(self.prev_span);
                        stmt.kind = StmtKind::Expr(self.mk_expr_err(sp));
                    }
                }
            }
            StmtKind::Local(..) => {
                // We used to incorrectly allow a macro-expanded let statement to lack a semicolon.
                if macro_legacy_warnings && self.token != token::Semi {
                    self.warn_missing_semicolon();
                } else {
                    self.expect_semi()?;
                    eat_semi = false;
                }
            }
            _ => {}
        }
        if eat_semi && self.eat(&token::Semi) {
            stmt = stmt.add_trailing_semicolon();
        }
        stmt.span = stmt.span.to(self.prev_span);
        Ok(Some(stmt))
    }
pub fn parse_full_stmt ( & mut self , macro_legacy_warnings : bool ) -> PResult < ' a , Option < Stmt > > { // Skip looking for a trailing semicolon when we have an interpolated statement. maybe_whole ! ( self NtStmt x Some ( x ) ) ; let mut stmt = match self . parse_stmt_without_recovery ( macro_legacy_warnings ) ? { Some ( stmt ) => stmt , None => return Ok ( None ) , } ; let mut eat_semi = true ; match stmt . kind { StmtKind :: Expr ( ref expr ) if self . token != token :: Eof => { // expression without semicolon if classify :: expr_requires_semi_to_be_stmt ( expr ) { // Just check for errors and recover; do not eat semicolon yet. if let Err ( mut e ) = self . expect_one_of ( & [ ] , & [ token :: Semi , token :: CloseDelim ( token :: Brace ) ] ) { e . emit ( ) ; self . recover_stmt ( ) ; // Don't complain about type errors in body tail after parse error (#57383). let sp = expr . span . to ( self . prev_span ) ; stmt . kind = StmtKind :: Expr ( self . mk_expr_err ( sp ) ) ; } } } StmtKind :: Local ( .. ) => { // We used to incorrectly allow a macro-expanded let statement to lack a semicolon. if macro_legacy_warnings && self . token != token :: Semi { self . warn_missing_semicolon ( ) ; } else { self . expect_semi ( ) ? ; eat_semi = false ; } } _ => { } } if eat_semi && self . eat ( & token :: Semi ) { stmt = stmt . add_trailing_semicolon ( ) ; } stmt . span = stmt . span . to ( self . prev_span ) ; Ok ( Some ( stmt ) ) }
Parses a statement, including the trailing semicolon.
Parses a statement including the trailing semicolon .
&mut self
macro_legacy_warnings
bool