Creates a checkpoint to which the parser can later return to using [`Self::rewind`].
(&self)
| 865 | |
| 866 | /// Creates a checkpoint to which the parser can later return to using [`Self::rewind`]. |
| 867 | fn checkpoint(&self) -> ParserCheckpoint { |
| 868 | ParserCheckpoint { |
| 869 | tokens: self.tokens.checkpoint(), |
| 870 | errors_position: self.errors.len(), |
| 871 | unsupported_syntax_errors_position: self.unsupported_syntax_errors.len(), |
| 872 | current_token_id: self.current_token_id, |
| 873 | prev_token_end: self.prev_token_end, |
| 874 | recovery_context: self.recovery_context, |
| 875 | } |
| 876 | } |
| 877 | |
| 878 | /// Restore the parser to the given checkpoint. |
| 879 | fn rewind(&mut self, checkpoint: ParserCheckpoint) { |
no test coverage detected