Parses a binding target in an `as` or mapping pattern.
(&mut self)
| 308 | |
| 309 | /// Parses a binding target in an `as` or mapping pattern. |
| 310 | fn parse_match_pattern_target(&mut self) -> ast::Identifier { |
| 311 | // test_err invalid_match_pattern_target |
| 312 | // match value: |
| 313 | // case 1 as _: ... |
| 314 | // case {**_}: ... |
| 315 | // after = 1 |
| 316 | let identifier = self.parse_identifier(); |
| 317 | if identifier.is_valid() && identifier.id == "_" { |
| 318 | self.add_error(ParseErrorType::InvalidMatchPatternTarget, &identifier); |
| 319 | } |
| 320 | identifier |
| 321 | } |
| 322 | |
| 323 | /// Parses a parenthesized pattern or a sequence pattern. |
| 324 | /// |
no test coverage detected