Parses a block of statements. # Panics If the parser isn't positioned at an `Indent` token.
(&mut self)
| 3152 | /// |
| 3153 | /// If the parser isn't positioned at an `Indent` token. |
| 3154 | fn parse_block(&mut self) -> Suite { |
| 3155 | self.bump(TokenKind::Indent); |
| 3156 | |
| 3157 | let statements = self.with_recursion(|parser| { |
| 3158 | let snapshot = parser.stmt_scratch.snapshot(); |
| 3159 | parser.parse_list(RecoveryContextKind::BlockStatements, |parser| { |
| 3160 | let statement = parser.parse_statement(); |
| 3161 | parser.stmt_scratch.push(statement); |
| 3162 | }); |
| 3163 | |
| 3164 | parser.stmt_scratch.take_thin_vec(snapshot) |
| 3165 | }); |
| 3166 | |
| 3167 | self.expect(TokenKind::Dedent); |
| 3168 | |
| 3169 | statements |
| 3170 | } |
| 3171 | |
| 3172 | /// Parses a single parameter for the given function kind. |
| 3173 | /// |
no test coverage detected