Parses a star pattern. # Panics If the parser isn't positioned at a `*` token. See:
(&mut self)
| 272 | /// |
| 273 | /// See: <https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-star_pattern> |
| 274 | fn parse_match_pattern_star(&mut self) -> ast::PatternMatchStar { |
| 275 | let start = self.node_start(); |
| 276 | self.bump(TokenKind::Star); |
| 277 | |
| 278 | let ident = self.parse_identifier(); |
| 279 | |
| 280 | ast::PatternMatchStar { |
| 281 | range: self.node_range(start), |
| 282 | name: if ident.is_valid() && ident.id == "_" { |
| 283 | None |
| 284 | } else { |
| 285 | Some(ident) |
| 286 | }, |
| 287 | node_index: AtomicNodeIndex::NONE, |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | /// Parses a binding target in an `as` or mapping pattern. |
| 292 | fn parse_match_pattern_target(&mut self) -> ast::Identifier { |
no test coverage detected