Parses a list of comprehension generators. These are the `for` and `async for` clauses in a comprehension, optionally followed by `if` clauses. See:
(&mut self)
| 2608 | /// |
| 2609 | /// See: <https://docs.python.org/3/reference/expressions.html#grammar-token-python-grammar-comp_for> |
| 2610 | fn parse_generators(&mut self) -> Vec<ast::Comprehension> { |
| 2611 | const GENERATOR_SET: TokenSet = TokenSet::new([TokenKind::For, TokenKind::Async]); |
| 2612 | |
| 2613 | let mut generators = Vec::with_capacity(1); |
| 2614 | let mut progress = ParserProgress::default(); |
| 2615 | |
| 2616 | while self.at_ts(GENERATOR_SET) { |
| 2617 | progress.assert_progressing(self); |
| 2618 | generators.push(self.parse_comprehension()); |
| 2619 | } |
| 2620 | |
| 2621 | generators.shrink_to_fit(); |
| 2622 | |
| 2623 | generators |
| 2624 | } |
| 2625 | |
| 2626 | /// Parses a comprehension. |
| 2627 | /// |
no test coverage detected