Parses a block of statements. # Panics If the parser isn't positioned at an `Indent` token.
(&mut self)
| 3122 | /// |
| 3123 | /// If the parser isn't positioned at an `Indent` token. |
| 3124 | fn parse_block(&mut self) -> Suite { |
| 3125 | self.bump(TokenKind::Indent); |
| 3126 | |
| 3127 | let statements = self.with_recursion(|parser| { |
| 3128 | let snapshot = parser.stmt_scratch.snapshot(); |
| 3129 | parser.parse_list(RecoveryContextKind::BlockStatements, |parser| { |
| 3130 | let statement = parser.parse_statement(); |
| 3131 | parser.stmt_scratch.push(statement); |
| 3132 | }); |
| 3133 | |
| 3134 | parser.stmt_scratch.take_thin_vec(snapshot) |
| 3135 | }); |
| 3136 | |
| 3137 | self.expect(TokenKind::Dedent); |
| 3138 | |
| 3139 | statements |
| 3140 | } |
| 3141 | |
| 3142 | /// Parses a single parameter for the given function kind. |
| 3143 | /// |
no test coverage detected