Parses a star pattern. # Panics If the parser isn't positioned at a `*` token. See:
(&mut self)
| 290 | /// |
| 291 | /// See: <https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-star_pattern> |
| 292 | fn parse_match_pattern_star(&mut self) -> ast::PatternMatchStar { |
| 293 | let start = self.node_start(); |
| 294 | self.bump(TokenKind::Star); |
| 295 | |
| 296 | let ident = self.parse_identifier(); |
| 297 | |
| 298 | ast::PatternMatchStar { |
| 299 | range: self.node_range(start), |
| 300 | name: if ident.is_valid() && ident.id == "_" { |
| 301 | None |
| 302 | } else { |
| 303 | Some(ident) |
| 304 | }, |
| 305 | node_index: AtomicNodeIndex::NONE, |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | /// Parses a binding target in an `as` or mapping pattern. |
| 310 | fn parse_match_pattern_target(&mut self) -> ast::Identifier { |
no test coverage detected