Add an [`UnsupportedSyntaxError`] with the given [`UnsupportedSyntaxErrorKind`] and [`TextRange`] if its minimum version is less than [`Parser::target_version`].
(&mut self, kind: UnsupportedSyntaxErrorKind, range: TextRange)
| 682 | /// Add an [`UnsupportedSyntaxError`] with the given [`UnsupportedSyntaxErrorKind`] and |
| 683 | /// [`TextRange`] if its minimum version is less than [`Parser::target_version`]. |
| 684 | fn add_unsupported_syntax_error(&mut self, kind: UnsupportedSyntaxErrorKind, range: TextRange) { |
| 685 | if kind.is_unsupported(self.options.target_version) { |
| 686 | self.unsupported_syntax_errors.push(UnsupportedSyntaxError { |
| 687 | kind, |
| 688 | range, |
| 689 | target_version: self.options.target_version, |
| 690 | }); |
| 691 | } |
| 692 | } |
| 693 | |
| 694 | /// Returns `true` if the current token is of the given kind. |
| 695 | fn at(&self, kind: TokenKind) -> bool { |
no test coverage detected