Parses a binding target in an `as` or mapping pattern.
(&mut self)
| 290 | |
| 291 | /// Parses a binding target in an `as` or mapping pattern. |
| 292 | fn parse_match_pattern_target(&mut self) -> ast::Identifier { |
| 293 | // test_err invalid_match_pattern_target |
| 294 | // match value: |
| 295 | // case 1 as _: ... |
| 296 | // case {**_}: ... |
| 297 | // after = 1 |
| 298 | let identifier = self.parse_identifier(); |
| 299 | if identifier.is_valid() && identifier.id == "_" { |
| 300 | self.add_error(ParseErrorType::InvalidMatchPatternTarget, &identifier); |
| 301 | } |
| 302 | identifier |
| 303 | } |
| 304 | |
| 305 | /// Parses a parenthesized pattern or a sequence pattern. |
| 306 | /// |
no test coverage detected